Scott Hughes wrote:
On 6/14/10 9:22 AM, Eric Shubert wrote:
Scott Hughes wrote:
After getting the unison sync working properly I attempted to setup
the job so that it would not email every five minutes with the unison
output. After Googling, found that if I put "2>&1 > /dev/null" after
the job, it would stop the email. The entire cron line looks like
this: "*/5 * * * * root /usr/local/sbin/sync-qmail 2>&1 > /dev/null"
Was I misinformed or is CentOS 5 just different in how one stops the
emails from cron?
Thanks in advance for any suggestions!
Scott
Different than what/how?
Basically is the syntax I have above correct or should I be doing this a
different way? I noticed that there are other items in the crontab that
use the same ending (2>&1 > /dev/null) and I do not get emails from those.
Thanks,
Scott
---------------------------------------------------------------------------------
That 'ending' is pretty conventional shell script coding. It says:
Redirect stderr (2>) to stdout (&1). Then redirect stdout (>, or 1>) to
/dev/null. Order is important here. If you redirect stdout before
stderr, then stderr will not come along with stdout because std has
already been redirected. You would need to ">/dev/null 2>/dev/null" to
get the same effect.
--
-Eric 'shubes'
---------------------------------------------------------------------------------
Qmailtoaster is sponsored by Vickers Consulting Group
(www.vickersconsulting.com)
Vickers Consulting Group offers Qmailtoaster support and installations.
If you need professional help with your setup, contact them today!
---------------------------------------------------------------------------------
Please visit qmailtoaster.com for the latest news, updates, and packages.
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]