peppeocchi / php-cron-scheduler

PHP cron job scheduler
MIT License
808 stars 143 forks source link

How to do a job once? #111

Closed rtanzifi closed 4 years ago

rtanzifi commented 4 years ago

Hi. can i run a job just once at specific time with seconds? for Example 2020-08-31 20:30:59?

peppeocchi commented 4 years ago

Hi, please have a look at the documentation here, you can specify a date for when the job should run

$scheduler->php('script.php')->date('2020-08-31 20:30');

Please note that with cronjobs you can't specify seconds. There are workaround that go beyond the purpose of this library. https://unix.stackexchange.com/questions/11102/cron-running-job-every-15-seconds