In article <m0uNKfS-0008vXC@kaos.tower.net.au>,
Karl Ferguson <firstname.lastname@example.org> wrote:
>> Just a quick question!!
>> How can I stop cron sending a message root everytime it runs a script. I
>> have a couple of cron jobs that run every 15 minutes and I am getting
>> hundreds of messages a day.
>> Thanks in advance.
>In the /etc/crontab whack a "2>&1 > /dev/null" on the end of it. Works
>here anyway :-)
If you really want to suppress stderr output, you'll want to use
">/dev/null 2>&1" (the other way around).
The "2>&1 > /dev/null" connected stdout to /dev/null and stderr
to the _original_ stdout. What happens now is that all normal
output from a script will be sent to /dev/null, and the stderr
output (probably real errors) will be mailed.
Hmm. Not so bad. That's probably just what you want. But I
think the 2>&1 is superfluous.
+ Miquel van Smoorenburg + Cistron Internet Services + Living is a |
| email@example.com (SP6) | Independent Dutch ISP | horizontal |
+ firstname.lastname@example.org + http://www.cistron.nl/ + fall +
- From: Andrew Stephen <email@example.com>
- Re: Cron
- From: firstname.lastname@example.org (Karl Ferguson)