I hate cron jobs

I hate cron jobs

By Joe Hourcle from DC.pm, bluegrass.pm
Date: Saturday, 11 April 2015 11:30
Duration: 25 minutes
Target audience: Any
Language: English
Tags: cron sysadmin

Cron is a really useful tool, but if you're not careful, you end up with e-mail few minutes reporting that something was run. If you don't go through every last report examining it line by line, you might miss when something actually breaks.

After years of putting up with it or writing wrapper scripts that silence output unless certain conditions are met, I've created a more generic wrapper that can :

* handle 'highlander' conditions
* kill commands that run too long
* silence output unless a non-zero exit status
* silence output unless something's sent to STDERR
* silence output if it matches acceptable patterns
* highlight lines that aren't in the list of patterns

Note that this code is not yet released. My place of work has a formal 'software release' procedure that I'm still trying to work through.

Attended by: Graham Ollis (‎plicease‎), Rob Jefferson (‎techstep‎),