Question

The log file is located at /var/log/cron. Its size grows too fast and it seems to contain a lot of unimportant data that I would never want to see. So I try to find a way to turn it off but still don't know how.

Here are some more details about the crontab:

crontab -l
*/5 * * * * /usr/sbin/ntpdate 10.0.1.10
*/1 * * * * cd /tmp && netstat -an|awk '/tcp/ {print $6}'|sort|uniq -c > net.tmp && mv -f net.tmp net.cache
*/1 * * * * /script/svrcheck/openvpn.sh > /dev/null 2>&1


tail /var/log/cron
Dec 17 09:25:01 HB04 crond[54509]: (root) CMD (/usr/sbin/ntpdate 10.0.1.10)
Dec 17 09:25:01 HB04 crond[54500]: (root) CMD (/script/svrcheck/openvpn.sh > /dev/null 2>&1)
Dec 17 09:25:01 HB04 crond[54504]: (root) CMD (cd /tmp && netstat -an|awk '/tcp/ {print $6}'|sort|uniq -c > net.tmp && mv -f net.tmp net.cache)

Please let me know if I could provide you more info.

Was it helpful?

Solution

you can control logging using syslog.conf

comment the cron entry inside the syslog.conf as follows .

 auth,authpriv.*                 /var/log/auth.log

 *.*;auth,authpriv.none,cron.none  -/var/log/syslog

  #cron.*                         /var/log/cron

and restart the syslog.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top