Charles Howse chowse at
Wed Nov 26 09:53:14 PST 2003

On Wednesday 26 November 2003 10:41 am, stuart.gibson at wrote:
> Hi,
> I have a number of scripts that run every night using a crontab.  In my
> crontab file I'm using the MAILTO flag to get cron to email me every
> time it runs which results in a lot of emails.
> Is there any way of instructing cron to only email me if the cron job
> fails?

By default, cron will email you whatever would be shown on the terminal when 
the script runs.
The way I get around this is to redirect the stdout of the script to /dev/
Like this:
0 0 * * * /root/bin/ > /dev/null


Random Murphy's Law:
All general statements are false.  (Think about it.)

More information about the freebsd-questions mailing list