The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Cron::RunJob - Monitor Cron Jobs

SYNOPSIS

        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);
        

DESCRIPTION

Run and monitor a command.

new()

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.

run(cmd, (args))

Runs the command.

failed()

Returns true if the command failed.

stderr()

Returns STDERR of the command.

stdout()

Returns STDOUT of the command.

AUTHOR

Kiel R Stirling, <kielstr@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.