#!/bin/bash # Wolfram Schlich # 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