[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Cron

In article <m0uNKfS-0008vXC@kaos.tower.net.au>,
Karl Ferguson <karl@kaos.tower.net.au> 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.
>> Andrew
>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     |
| miquels@cistron.nl (SP6) | Independent Dutch ISP     |   horizontal     |
+ miquels@drinkel.ow.org   + http://www.cistron.nl/    +      fall        +

Reply to: