+------------------------------------------------------------------------------ | On 2015-01-03 14:02:15, Matthew Weigel wrote: | > No, the behavior he described is accurate: cron(8) sends email if a job > produced output, irrespective of its exit status. > > Google is littered with people trying to figure out how to get cron(8) > to send email based on exit code... so it's certainly a common problem. > Maybe some Unix decided to send email based on exit status, but > OpenBSD's does not.
I have been wrapping cron jobs in App::Cronjob for ~5 years on Linux, Solaris/illumos, and OpenBSD: http://search.cpan.org/~rjbs/App-Cronjob-1.200004/lib/App/Cronjob.pm http://search.cpan.org/~rjbs/App-Cronjob-1.200004/bin/cronjob http://advent.rjbs.manxome.org/2009/2009-12-07.html https://github.com/rjbs/App-Cronjob Works quite well. Has other useful features in addition to emitting or supressing noise on exit code. Cheers. -- bdha

