blob: f6047c692a664f53bee77da19a5d7ed5af438aa3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
|
#!/bin/bash
# Wolfram Schlich <wschlich@gentoo.org>
# Script to maintain the /var/log/syslog-ng.remote/current symlink
# To be placed in /etc/cron.daily
syslog_ng_remote_dir=/var/log/syslog-ng.remote
current="$(date +%Y/%m/%d)"
current_src="${syslog_ng_remote_dir}/${current}"
current_dst="${syslog_ng_remote_dir}/current"
test -d "${current_src}" || exit 1
test -L "${current_dst}" && { rm -f "${current_dst}" || exit 2; }
ln -sf "${current}" "${current_dst}" || exit 3
|