'atq/at' scheduled job timer command line wrapper.
atq/at is pre-installd majaor linux dist. alarm or scheduling timer run once at specified.
https://manpages.debian.org/jessie/at/at.1.en.html
composer require takuya/php-atq-wrapper
<?php
use SystemUtil\AtJobs;
$at_job = new AtJobs( 'ssh server docker exec ubuntu1604 -- at' );
$id = $at_job->add( '+30days', 'echo Hello 2','s' );
$at_job->exists($id);// => true
$at_job->get_body( $id ); //=> /bin/sh body will be executed.
$at_job->remove($id); //=> cancel job.
<?php
use SystemUtil\AtJobs;
$at_job = new AtJobs( 'ssh server docker exec ubuntu1604 -- at' );
foreach ($at_job->queue() as $job) {
$job->id;
$job->start;
$job->q;
$job->user;
$job->body();
}
<?php
use SystemUtil\AtJobs;
$at_job = new AtJobs( 'ssh server docker exec ubuntu1604 -- at' );
foreach ($at_job->queue('a') as $job) {
$job->remove();
}