Help - Search - Members - Calendar
Full Version: Telling cron not to generate a syslog message for a job
Linuxhelp > Support > Technical Support
pneumonochrome
I have a cron job that I need to run every 10 minutes. The line in the crontab looks like this:

CODE
*/10  *  * * *  root    /path/to/script.pl >> /dev/null 2>&1


Every time it runs, it creates an entry in /var/log/messages that looks like this:

CODE
Dec 18 17:40:01 gentoo-tk-www01 cron[16120]: (root) CMD (/path/to/script.pl >> /dev/null 2>&1)


I'd like, if I can, to tell cron *not* to generate that log entry, as 144 entries in /var/log/messages a day from a script that I'll know when it stops working without having to look at the logs are just a bit much for me. I apologize if this has been covered before, my search of the forums didn't turn anything up. I'd like to leave it logging when it runs the other jobs I have set to run via cron, as they generally don't run any more frequently than once a day, just this one I would like not to log.

Any ideas on how I might approach this?

Thanks in advance.
markjr
QUOTE (pneumonochrome @ Dec 18 2007, 08:55 PM) *
I have a cron job that I need to run every 10 minutes. The line in the crontab looks like this:

CODE
*/10  *  * * *  root    /path/to/script.pl >> /dev/null 2>&1


Every time it runs, it creates an entry in /var/log/messages that looks like this:

CODE
Dec 18 17:40:01 gentoo-tk-www01 cron[16120]: (root) CMD (/path/to/script.pl >> /dev/null 2>&1)


I'd like, if I can, to tell cron *not* to generate that log entry, as 144 entries in /var/log/messages a day from a script that I'll know when it stops working without having to look at the logs are just a bit much for me. I apologize if this has been covered before, my search of the forums didn't turn anything up. I'd like to leave it logging when it runs the other jobs I have set to run via cron, as they generally don't run any more frequently than once a day, just this one I would like not to log.

Any ideas on how I might approach this?

Thanks in advance.


Add cron.none to the line in /etc/syslogd.conf that is logging to /var/log/messages

I always like to setup a separate cron facility in my syslogd.conf anyway, logging to something like /var/log/cron
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2017 Invision Power Services, Inc.