If you just want to get rid of "normal" output, and only have it email you if there is error output, you can redirect stdout to /dev/null, like thus:
5 * * * * yourcommandhere >/dev/null
This sends normal output to the bit bucket, but anything the command puts out the stderr (the error output) will get emailed you.
If you want to ignore all output, error and normal, you can "tie" the error output to go to the same place the normal output goes, like thus:
5 * * * * yourcommandhere >/dev/null 2>&1
Now you won't get any email.
Another option for turning off email is to set the MAILTO variable to NULL. See the manpage for more discussion on this option.
Thanks for the pointer, Jonathan.
ReplyDelete