I undestand that you can create hourly tasks on Laravel by using:
$schedule->command('catalog:update')->hourly();
however is there a way to do for example every 2 hours or 5 hours? I couldn't find it on documentation or here.
You've tagged your question as Laravel 4, but I don't think the scheduler was introduced until Laravel 5...
Anyway, based on the code snippet you've posted, you could use the cron
method.
$schedule->command('catalog:update')->cron('0 */2 * * *'); // every 2 hours $schedule->command('catalog:update')->cron('0 */5 * * *'); // every 5 hours
See the docs for other options. https://laravel.com/docs/5.4/scheduling#defining-schedules
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