cronjob – emails to /dev/null or /dev/null 2>&1

We can send the output of our cron jobs to /dev/null, but this way error and other debug messages aren’t lost and we will be notified when the occur!

If you don’t want to receive them add  2>&1 to it.

* * * * * /bin/ping -c 10 > /dev/null 2>&1 – no emails will be sent
* * * * * /bin/ping -c 10 > /dev/null – error and debug messages will be sent.


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.