cronで
/usr/sbin/logrotate /etc/logrotate.confが実行されると /var/log/cron の中身が空のままになる。。。
logrotate.conf の include行がうまくいっていないのか? 他に何か原因があるのか?
/etc/rc.d/rc.M も関係しているかも。
http://homepage2.nifty.com/ssfu/others/computer/linux_logrotate01.html
を読んで、
/etc/logrotate.d/syslogo を改造、
/var/log/debug /var/log/maillog /var/log/messages /var/log/secure /var/log/spooler /var/log/syslog {/etc/logrotate.d/cron を作成
sharedscripts
postrotate
/bin/kill -HUP `cat /var/run/syslogd.pid 2>/dev/null` 2>/dev/null || true
endscript
}
(/var/log/cron削除)
/var/log/cron {
missingok
notifempty
postrotate
# /bin/kill -HUP `/bin/cat /var/run/crond.pid`
/usr/bin/killall -HUP crond
endscript
}
/etc/rc.d/rc.localというスクリプトファイルの末尾辺りに、次の一行を追加します。
/usr/sbin/logrotate /etc/logrotate_local.conf
echo executed /usr/sbin/logrotate /etc/logrotate_local.conf. Done.
sleep 3
<<