Skip to content

Adding Jobs From A Crontab

Sid Roberts edited this page Aug 18, 2019 · 2 revisions

You can also add jobs from a Crontab file, such as this one:

* * * * * /usr/bin/php /path/to/cli.php cron
$cron = new \Sid\Phalcon\Cron\Manager();

$cron->addCrontab("/path/to/crontab");

To get an array of System Job instances from the Crontab:

$crontab = new \Sid\Phalcon\Cron\CrontabParser("/path/to/crontab");

$jobs = $crontab->getJobs();
Clone this wiki locally