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 script. How do I stop it from sending any notification? Thank you very much,
-> -> 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 -> script. -> 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.
Then,
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:
/dev/null 2>&1
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:
MAILTO=""
Or, try
http://www.google.com/search?hl=en&q=stopping+crontab+from+email+root
or various other things...
thanks and kind regards!
- rh
-- Robert - Abba Communications Computer & Internet Services (509) 624-7159 - www.abbacomm.net
-> -> 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 -> script. -> How do I stop it from sending any notification? -> Thank you very much, -> -- -> Fajar Priyanto
Oh I forgot, I do it this way too, you may need a second chicken for this one though.
0,15,30,45 * * * * /usr/local/sbin/somescript 1>/dev/null 2>/dev/null
Ymmv ;->
- rh
-- Robert - Abba Communications Computer & Internet Services (509) 624-7159 - www.abbacomm.net
On Monday 25 September 2006 13:38, Email Lists wrote:
Oh I forgot, I do it this way too, you may need a second chicken for this one though.
0,15,30,45 * * * * /usr/local/sbin/somescript 1>/dev/null 2>/dev/null
Thank you very much, Robert. It works wondefully :)
On Sun, 2006-09-24 at 23:38 -0700, Email Lists wrote:
-> <snip>
Oh I forgot, I do it this way too, you may need a second chicken for this one though.
0,15,30,45 * * * * /usr/local/sbin/somescript 1>/dev/null 2>/dev/null
And more recent versions of bash permit &>/dev/null to redirect both stdout and stderr. To append, still need the separate redirects though.
Ymmv ;->
- rh
-- Robert - Abba Communications Computer & Internet Services (509) 624-7159 - www.abbacomm.net
<snip list stuff>
-- Bill
Email Lists spake the following on 9/24/2006 11:38 PM:
-> -> 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 -> script. -> How do I stop it from sending any notification? -> Thank you very much, -> -- -> Fajar Priyanto
Oh I forgot, I do it this way too, you may need a second chicken for this one though.
But if you use a shortcut, can you use a Cornish game hen? Or maybe a quail or two?