Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Reporting test failures within cron

by davidrw (Prior)
on Sep 13, 2005 at 12:23 UTC ( #491559=note: print w/ replies, xml ) Need Help??


in reply to Reporting test failures within cron

Assuming that whatever you're running (i think prove does) uses exit codes on failure, something simple like this would work (bash syntax):

0 3 * * * prove foo.t > /tmp/prove$$ 2>&1 || cat /tmp/prove$$
And it relies on cron's behavior of emailing you whatever output is generated by a job -- here we're printing the whole output iff it failed..


Comment on Re: Reporting test failures within cron
Select or Download Code
Re^2: Reporting test failures within cron
by Anonymous Monk on Jan 27, 2010 at 17:18 UTC
    This works but for security reasons it would be better to do something like: (tmp_file_name=`mktemp`; prove foo.t > "$tmp_file_name" 2>&1 || cat "$tmp_file_name")

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (12)
As of 2014-12-18 23:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (67 votes), past polls