[CentOS] To redirect any message into /dev/null
lists06 at abbacomm.net
Mon Sep 25 06:33:21 UTC 2006
-> Hi all,
-> I'm running a script in my crontab like this:
-> */50 * * * * /root/scripts/keepjobrun 2>&1 > /dev/null
-> However, crontab always sends a message to root (me) about the above
-> How do I stop it from sending any notification?
-> Thank you very much,
-> Fajar Priyanto | Reg'd Linux User #327841 | Linux tutorial
Scold it with your left index finger 3 times. Not less than 3, unless
counting to three slowly, 1, 2, 3, hurl the Holy Chicken of Antioch and say
bad, bad, bad crontab script and read it the KJV Bible starting in the New
Testament with the book of James.
Disabling email: If any output is produced by a command executed from a
crontab, the cron daemon will normally email the user that output.
To silence any particular command, you may redirect its output to /dev/null.
To stop receiving email output from crontab, append the following to any
command. This will redirect stdout to null while redirecting stderr to
stdout, so you receive no errors if they occur:
Under the commonly used Vixie cron, you can also turn off email notification
for all of a particular user's cronjobs by adding this line to the beginning
of their crontab:
or various other things...
thanks and kind regards!
Robert - Abba Communications
Computer & Internet Services
(509) 624-7159 - www.abbacomm.net
More information about the CentOS