Clayton, Nik [IT] ([EMAIL PROTECTED]) wrote:
> [ warning: gratuitous Perl content follows ]
> 
> So I was noodling around the other day, trying to come up with a 
> lightweight mechanism to generate useful output from cron jobs.  Most
> of the time you want a cron job to be silent, so you don't get flooded
> with mail every time it works.  But you do want output if something 
> goes wrong (specifically, you called die()), and it would be really
> handy if at that point you got *all* the verbose output, so it's easy
> to see where the script got to when it died.

[snipped Perl solution]

Or you could use a wrapper, like the following slightly ugly but quick
hack:

  http://adamspiers.org/computing/quietrun

which can easily be reused for non-Perl.

I find myself using the "small pluggable tools" UNIX approach more and
more these days, e.g.

  # Let CPU sleep when we do
  00 1 * * *   quietrun run-with-local-X-display xscreensaver-command -throttle
  30 7 * * *   quietrun run-with-local-X-display xscreensaver-command -unthrottle

Reply via email to