cronjobs query

Chris Grau chris at chrisgrau.com
Sun Nov 30 07:09:19 UTC 2003


On Sun, Nov 30, 2003 at 04:38:28AM +0000, Craig Tinson wrote:
> hey guys.. quick question.. thought I had this figured but i must be 
> missing something
> 
> I have the following in /etc/crontab
> 
> 0-59/5 * * * * root /usr/bin/mrtg /usr/share/toaster/mrtg/qmailmrtg.cfg 
> 2>&1 > /dev/null
> 
> I was under the impression that the "2>&1 > /dev/null" would quit crond 
> sending root an email with the results of the cron job..
> 
> but I'm still getting mails every 5 mins.. how can I get it to just kill 
> the output?

You need to switch the order of the redirection operators:

	... >/dev/null 2>&1

Without going into too much detail, you need to redirect stderr to
stdout AFTER you've already redirected stdout to a file (or a device in
this case).

-chris





More information about the fedora-list mailing list