Jeremy Visser wrote:
On Sat, 2010-01-23 at 10:48 +1100, Jake Anderson wrote:
Simon Males wrote:
I'm interested to hear how system administrators handle the plethora
of E-Mails servers tend to generate. Especially ones with various cron
jobs.
your best bet is to suppress any email that isn't an error.
And just how is that done?
Sounds good in theory, but using the ">/dev/null", "2>&1", "||", or "&&"
syntax, I don't know of a way to only send output to /dev/null if it was
a success, but to stdout or stderr if it was an error (non-zero).
Only all or none.
If you were to pipe the output to something, is there any way the
program can read the program previous in the pipeline's error code? If
so, it would be possible to hack something like tee to do the job.
(Doubtful, because stdin is a file handle, not an error code.)
I believe redirect stdout to /dev/null but leave stderror
if something errors you get the error message, but normal output just
goes into the bit bucket
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html