Stefan Thyberg Asked: 2009-07-17 06:10:53 +0800 CST2009-07-17 06:10:53 +0800 CST 2009-07-17 06:10:53 +0800 CST Disable crontab mail 772 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? linux email cron 2 Answers Voted Best Answer Stefan Thyberg 2009-07-17T06:13:04+08:002009-07-17T06:13:04+08:00 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. Andre Miller 2009-07-17T06:25:58+08:002009-07-17T06:25:58+08:00 To prevent output of both stdout and stderr use the following syntax: <command> > /dev/null 2>&1
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:
or you redirect each cronjobs output to /dev/null:
The second having the advantage that output on stderr should still be mailed to you.
To prevent output of both stdout and stderr use the following syntax: