Disable crontab mail alerts

To prevent mail messages piling up from your crontab commands you add the following at the end of your crontab line:

>/dev/null 2>&1

or

&> /dev/null

So for example crontab entry:

@weekly /usr/local/bin/gravity.sh

will become:

@weekly /usr/local/bin/gravity.sh >/dev/null 2>&1

Alternative would be using MAILTO=”” variable at the start of your crontab file.

Please edit crontab file with command crontab -e and add at the top of the file:

MAILTO=""

Save and close the file.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.