对于我的生活,我无法弄清楚如何禁用logrotate每周给我发送OK消息,如下所示:
/etc/cron.daily/logrotate: ok
crontab是
25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
而脚本是
# Clean non existent log file entries from status file cd /var/lib/logrotate test -e status || touch status head -1 status > status.clean sed 's/"//g' status | while read logfile date do [ -e "$logfile" ] && echo "\"$logfile\" $date" done >> status.clean mv status.clean status test -x /usr/sbin/logrotate || exit 0 /usr/sbin/logrotate /etc/logrotate.conf ~
我希望看到有错误的电子邮件,所以我不想将stdoutredirect到/ dev / null。