我正在运行Debian与PHP 5.3.3-7+squeeze14。有几个cronjob可以清理我的php会话:
(cron.d)09,39 * * * * root [ -x /usr/lib/php5/maxlifetime ] && [ -d /var/lib/php5 ] && find /var/lib/php5/ -type f -cmin +$(/usr/lib/php5/maxlifetime) -delete
(crontab)47 * * * * root cd / && run-parts --report /etc/cron.hourly
(crontab)45 0 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
(crontab)34 1 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
(crontab)44 3 4 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
这些Crons扔....
, cron.log
行Jan 4 11:47:01 flowl /USR/SBIN/CRON[3976]: (root) CMD (cd / && run-parts --report /etc/cron.hourly)
Jan 4 12:09:01 flowl /USR/SBIN/CRON[3983]: (root) CMD ( [ -x /usr/lib/php5/maxlifetime ] && [ -d /var/lib/php5 ] && find /var/lib/php5/ -type f -cmin +$(/usr/lib/php5/maxlifetime) -delete)
, auth.log
行Jan 4 12:09:01 flowl CRON[3982]: pam_unix(cron:session): session opened for user root by (uid=0)`
Jan 4 12:09:01 flowl CRON[3982]: pam_unix(cron:session): session closed for user root`
我如何从(至少)auth.log中删除(所有这些烦人的)cron日志?我不经常查看cron.log,我可以用这些来生活。
提前感谢!丹
取自http://blog.flowl.info/2013/reduce-syslog-logging-io-raspberrypi/:当rsyslog替换syslog时,我们可以做以下操作:
in /etc/rsyslogd.conf
:替换auth,authpriv.* /var/log/auth.log
:msg, contains, "pam_unix(cron:session)" ~
auth,authpriv.* /var/log/auth.log
同样适用于其他日志文件