Daniel W.
Daniel W.

Reputation: 32350

how-to silence PHP Session GC Cron

I'm running Debian with PHP 5.3.3-7+squeeze14. There are several cronjobs that gc clean my php sessions:


(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 )

These Crons throw....

...cron.log lines

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 lines

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`

How do I remove (all these annoying) cron logs from (at least) auth.log? im not looking into cron.log that often I could life just with these.

Thanks in advance! Dan

Upvotes: 3

Views: 1653

Answers (1)

Daniel W.
Daniel W.

Reputation: 32350

Take from http://blog.flowl.info/2013/reduce-syslog-logging-io-raspberrypi/: As rsyslog replaced syslog, we can do the following:

in /etc/rsyslogd.conf: replace auth,authpriv.* /var/log/auth.log

by:

:msg, contains, "pam_unix(cron:session)" ~
auth,authpriv.* /var/log/auth.log

same goes for other log files

Upvotes: 2

Related Questions