How do I keep my crontab from sending an email every time it runs?
Add the following > /dev/null 2>&1
0 * * * * /home/user/backup.pl >/dev/null 2>&1
The >> /dev/null 2>&1 part means to send any standard output to /dev/null (the linux trash can) and to redirect standard error (2) to the same place as the standard output (1). Basically it runs the command without any output to a terminal etc.
>/dev/null 2>&1
If you wanted to save the output of a certain command you can replace the “>> /dev/null 2>&1″ with “>> /home/user/script.log 2>&1″
Leave a Reply
You must be logged in to post a comment.