jobby - PHP cron менеджер
Позволяет создавать и добавлять job-ы без правки crontab.
Пример использования
add('CommandExample', [
// Run a shell commands
'command' => 'ls',
// Ordinary crontab schedule format is supported.
// This schedule runs every hour.
// You could also insert DateTime string in the format of Y-m-d H:i:s.
'schedule' => '0 * * * *',
// Stdout and stderr is sent to the specified file
'output' => 'logs/command.log',
// You can turn off a job by setting 'enabled' to false
'enabled' => true,
]);
$jobby->add('ClosureExample', [
// Invoke PHP closures
'closure' => function() {
echo "I'm a function!\n";
return true;
},
// This function will run every other hour
'schedule' => '0 */2 * * *',
'output' => 'logs/closure.log',
]);
$jobby->run();
https://github.com/jobbyphp/jobby/