How can I run Laravel scheduler twice daily at specific hours? Let's say I want my command to run every day at 9am and 5pm
There is an option to use twiceDaily, but I'm not sure how to specify hours
We go to the 'Triggers' tab and select the 'Edit' option: An 'Edit Trigger' screen will appear. To set the script to run hourly, we select the 'Repeat task…' option and enable it.
You can use manual cron expression:
$schedule->command('foo')->cron('0 9,17 * * *');
Read more: http://laravel.com/docs/5.0/artisan#scheduling-artisan-commands
If you're not familiar with cron expressions, here's the nice GUI: http://cron.nmonitoring.com/cron-generator.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With