Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

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

by FloydATC (Deacon)
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

Replies are listed 'Best First'.
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" < /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?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1065047]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (5)
As of 2018-05-21 11:12 GMT
Find Nodes?
    Voting Booth?