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

Re: crontab $MAILTO question



Hi,

Alec (alec1976nyc@yahoo.com) wrote:
> 
> I make backups using a cron job and I set MAILTO=""
> Can I configure cron to mail me
> a) *only* when there were errors
> b) email only STDERR (not STDOUT)

You could simply supply a valid MAILTO and send STDOUT to /dev/null
like so:

MAILTO=whoever
* * * * * whoever dothisandthat > /dev/null

That way you will only get an email when there is output to STDERR.

Hth,
Gordon

-- 
Gordon Fraser                   We come to bury DOS, not to praise it.
gordon@freakzone.net            (Paul Vojta, vojta@math.berkeley.edu,
http://www.freakzone.net        paraphrasing a quote of Shakespeare)

Attachment: pgpjBVYzVGXiC.pgp
Description: PGP signature


Reply to: