Linux Help
guides forums blogs
Home Desktops Distributions ISO Images Logos Newbies Reviews Software Support & Resources Linuxhelp Wiki

Welcome Guest ( Log In | Register )



Advanced DNS Management
New ZoneEdit. New Managment.

FREE DNS Is Back

Sign Up Now
 
Reply to this topicStart new topic
> Telling cron not to generate a syslog message for a job
pneumonochrome
post Dec 18 2007, 07:55 PM
Post #1


Whats this Lie-nix Thing?
*

Group: Members
Posts: 1
Joined: 18-December 07
Member No.: 13,203



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.
Go to the top of the page
 
+Quote Post
markjr
post Dec 18 2007, 09:15 PM
Post #2


./configure
***

Group: Admin
Posts: 62
Joined: 9-February 06
Member No.: 6,054



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
Go to the top of the page
 
+Quote Post

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 24th October 2017 - 01:05 AM