On 2006-11-05 08:27, Hans Witvliet wrote:
Hi,
I've digesting this subject from the list, but still can not prevent cron from writing in /var/log/messages. Specially if it runs every couple of minutes, i don't to see it in my log file, (unless it fails)
The original line ended in &>/dev/null So the output from the script is sent to limbo.
But i dont want even to see that it is run. So according to some suggestions i expended it to &>/dev/null MAILTO=""
And added to /etc/sysconfig/cron: MAILTO=""
But this seems to be not enough..
Kind regards, Hans
If it is a root cron task, Carlos has already said how to get rid of the log entries. Otherwise.... You can log all cron messages to a dedicated cron log. In /etc/syslog-ng/syslog-ng.conf.in, find the following lines and uncomment the last two: # # Cron-messages in one file: # #destination cron { file("/var/log/cron"); }; #log { source(src); filter(f_cron); destination(cron); }; The run SuSEconfig to add the change to the real config file and restart the syslog daemon. Note: you don't want to change /etc/syslog-ng/syslog-ng.conf directly, because the next time SuSEconfig gets hold of it, it will use the .in file as a base, and wipe out your change. This won't get rid of the log entries every minute or so, but it will move them out of /var/log/messages. You could hack the syslog-ng config file to ignore this particular cron task (that is essentially how the firewall log entries get put into a dedicated firewall log), but that's a bit of work that I don't properly understand right now.