Cron::RunJob - Monitor Cron Jobs
use strict; use Cron::RunJob; my $job = Cron::RunJob->new( ONLY_ME => 1, MAIL_STDERR => 1, MAIL_STDOUT => 1, MAIL_TO => 'kielstr@cpan.org', MAIL_FROM => 'kielstr@cpan.org', MAIL_SUBJECT => 'Cron::RunJob test', RUNFILE_DIR => '.' ); $job->run(shift, @ARGV); print (($job->failed) ? $job->stderr : $job->stdout);
Run and monitor a command.
ONLY_ME
If true only allow one instance of the command.
RUNFILE_DIR
The location to create a run file.
MAIL_STDOUT
If true mail STDOUT to MAIL_TO.
MAIL_STDERR
If true mail STDERR to MAIL_TO.
MAIL_FROM
The return address for the email.
MAIL_SUBJECT
The subject of the email.
Runs the command.
Returns true if the command failed.
Returns STDERR of the command.
Returns STDOUT of the command.
Kiel R Stirling, <kielstr@cpan.org<gt>
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.
To install Cron::RunJob, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Cron::RunJob
CPAN shell
perl -MCPAN -e shell install Cron::RunJob
For more information on module installation, please visit the detailed CPAN module installation guide.