- SEE ALSO
- COPYRIGHT AND LICENSE
App::after - Run command after delay and/or other conditions
This document describes version 0.04 of App::after (from Perl distribution App-after), released on 2016-05-21.
See the included script after.
Run command after delay and/or other conditions.
Run command after 30-minute delay:
after( command => ["cmd"], delay => "30m");
Run command after 12 hour delay and time has passed 2016-04-18:
after( command => ["cmd"], delay => "12h", time => "2016-04-18");
Run command after 12 hour delay *or* time has passed 2016-04-18:
after( command => ["cmd"], delay => "12h", or => 1, time => "2016-04-18");
Run command after system uptime is 2 days:
after( command => ["cmd"], uptime => "2d");
Run command after system load is above 2.5:
after( command => ["cmd"], load_above => 2.5);
Run command after system load is between 1 and 5:
after( command => ["cmd"], load_above => 1, load_below => 5);
after will run command after all the specified conditions are met. A condition can be: delay (
--delay), current time (
--time), system uptime (
--uptime), system load falling below a certain value (
--load-below), system load rising above a certain value (
--load-above). More conditions will be available in the future.
This function is not exported.
Arguments ('*' denotes required arguments):
all => bool
Run command after all conditions are met (the default).
command* => array[str]
delay => duration
load_above => float
load_below => float
none => bool
Run command when none (instead of all) of the conditions are met.
or => bool
Run command after one condition (instead of all) is met.
time => date
uptime => duration
Returns an enveloped result (an array).
First element (status) is an integer containing HTTP status code (200 means OK, 4xx caller error, 5xx function error). Second element (msg) is a string containing error message, or 'OK' if status is 200. Third element (result) is optional, the actual result. Fourth element (meta) is called result metadata and is optional, a hash that contains extra information.
Return value: (any)
Please visit the project's homepage at https://metacpan.org/release/App-after.
Source repository is at https://github.com/perlancar/perl-App-after.
Please report any bugs or feature requests on the bugtracker website https://rt.cpan.org/Public/Dist/Display.html?Name=App-after
When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature.
http://onegeek.org/~tom/software/delay/. This CLI can also be used to run a command after specified delay or point of time.
Proc::Govern. This module can be used to run a command then pause it when system load is outside specified range. The distribution also comes with a CLI script.
This software is copyright (c) 2016 by email@example.com.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.