Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^2: Sanity check: Tiny wrapper script for /bin/mail

by FloydATC (Hermit)
on Nov 30, 2013 at 11:25 UTC ( #1065047=note: print w/ replies, xml ) Need Help??


in reply to Re: Sanity check: Tiny wrapper script for /bin/mail
in thread Sanity check: Tiny wrapper script for /bin/mail

I don't think a single one of those cron scripts return proper exit codes since they were originally meant to produce text output if problems were detected and otherwise just be quiet. But if they did then I suppose this solution would work. As a bonus, this approach would leave traces in /tmp which could be useful for summarizing. Hmm.

-- FloydATC

Time flies when you don't know what you're doing


Comment on Re^2: Sanity check: Tiny wrapper script for /bin/mail
Re^3: Sanity check: Tiny wrapper script for /bin/mail
by Bloodnok (Vicar) on Dec 02, 2013 at 09:14 UTC
    In which case, this might be slightly more effective...
    05 12 * * * root /home/atlas/tools/CRON_macscanner >/tmp/CRON_macscann +er 2>&1; test -s /tmp/CRON_macscanner && mail -s "[Nettverk][Error] C +RON_macscanner" email@address.here < /tmp/CRON_macscanner

    Be very wary of leaving/using traces in /tmp - on most OS'es, this gets emptied at shutdown &/or startup. If you definitely want records, then I'd suggest creating & using a subdirectory of /var/log.

    A user level that continues to overstate my experience :-))

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1065047]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (6)
As of 2014-09-18 09:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (109 votes), past polls