Disable cron email alert
October 14th, 2008 by vickyEver wondered how to disable the email alert sent when cron is executed? Easy help, there are various ways to achieve this, so feel free to use the one you like the best.
They all work, though.
However, there are two principles – one to send the email to /dev/null and other one disable it by cron EMAILTO directive.
Redirect to /dev/null is used in these ways:
>/dev/null 2>&1.
or
&> /dev/null
Those need to be added at the end of your crontab entry, like this:
0 1 * * * /path/yourscript.sh >/dev/null 2>&1
Or, as I said using EMAILTO would look in your crontab file like this:
EMAILTO=""
It should be placed on top of either /etc/crontab or you can define cron entries by executing: crontab -e
I hope this was helpfull…
Posted in General linux admin | No Comments »