Crontab: Difference between revisions

From James's Wiki
No edit summary
No edit summary
Line 11: Line 11:
send only normal output to null (will still email errors):
send only normal output to null (will still email errors):
  * * * * *      root    /usr/local/sbin/mycommand.sh <code>> /dev/null</code>
  * * * * *      root    /usr/local/sbin/mycommand.sh <code>> /dev/null</code>
[[File:001-8932bb3fb07f73dfd0a6c0c779f349b1.gif]]

Revision as of 12:38, 4 March 2018

to edit the crontab of a user

sudo crontab -u username -e

root crontab:

sudo crontab -e

send ALL (even errors) to null:

* * * * *       root    /usr/local/sbin/mycommand.sh > /dev/null 2>&1

send only normal output to null (will still email errors):

* * * * *       root    /usr/local/sbin/mycommand.sh > /dev/null

File:001-8932bb3fb07f73dfd0a6c0c779f349b1.gif