Linux – Disable crontab mail

cronemaillinux

By default, crontab on, for example, Debian, will mail any output of a job in your crontab to that user. How would one go about disabling this functionality?

Best Answer

There are two main ways of doing this, as I discovered.

Either you set the MAILTO-variable to nothing at the start of the file:

MAILTO=""

or you redirect each cronjobs output to /dev/null:

<command> > /dev/null

The second having the advantage that output on stderr should still be mailed to you.