NAME
Cron::RunJob - Monitor Cron Jobs
SYNOPSIS
use Cron::RunJob;
my $cmd = shift;
my $job = new CSU::Job
ONLY_ME => 1,
RUNFILE_DIR => "/var/run/",
MAIL_ERRORS => 1,
MAILTO => 'user@domain.com',
FROM => 'no-reply@domain.com',
SUBJECT => "[crond] Error -- $cmd",
;
$job->run_command($cmd, @args);
if ($job->exitcode) {
print $job->errstr. "\n\n" if $job->errstr;
} else {
print $job->output. "\n\n" if $job->output;
}
DESCRIPTION
Run a cmd and email any error to the supplied email address
AUTHOR
Kiel R Stirling, <kieldstr@cpan.org<gt>
COPYRIGHT AND LICENSE
Copyright (C) 2012 by Kiel R Stirling
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.14.2 or, at your option, any later version of Perl 5 you may have available.