[NTLUG:Discuss] Cron

Chris Cox cjcox at acm.org
Mon Apr 19 10:39:30 CDT 2004


Scott Hollomon wrote:
> I don't want the cron daemon to send me email when it runs, or better yet, to 
> email me when some jobs run but not others.  I tried to turn it all off by 
> doing the following:  edit the mail to line in /etc/crontab so that there was 
> no address, then I restarted crond.  But that didn't work.  Any suggestions?
> 
> 

Whatever the command is in cron.. you can redirect the output
 >/dev/null and 2>&1 as well.

e.g.
0 * * * *	mycroncommand >/dev/null 2>&1

You can redirect all mails to whatever the MAILTO variable
says... put that settting inside your crontab.... but it's
likely that you just want to redirect the output
certain jobs.

For the system wide stuff (/etc/crontab)... it's pretty much
the same.. just add the >/dev/null 2>&1 onto the ends of
the command lines for which you want NO mailed messages.





More information about the Discuss mailing list