Postings
Cron / Crontab – disable e-mail notifications
There are 2 ways to prevent cron to send out e-mail notifications after jobs are run:
- Ensure there are no output from the script(s) being run by sending the output to /dev/null
Simply append one of the following directives to the end of your script.>/dev/null 2>&1.
OR
&> /dev/null
Your crontab would now look something like:
0 1 5 10 * /path/to/script.sh >/dev/null 2>&1
OR
0 1 5 10 * /path/to/script.sh &> /dev/null
- As the e-mail notification is sent to the local account by default, it is possible to overwrite that by setting the MAILTO=”" variable within the crontab file. Simply enter the following at the start of your crontab file:
MAILTO=”"
so that it looks something like:
MAILTO=”"
0 1 5 10 * /path/to/script.sh &> /dev/null
Update MAILTO variable
Comments (0)
No Comments »
No comments yet.
RSS feed for comments on this post. TrackBack URL

