Doubt regarding the Task Schedule- Laravel events

Asked

Viewed 72 times

0

I have searched the documentation and other forums, but I did not find the answer.

Next, how often does a task start normally at what point? I know the method ->hourly() is executed every hour, but at what point? It runs for example at 13:00, 14:00, 15:00, etc. Or, depending on the time it was scheduled, it can run at, for example, 13:05, 14:05, 15:05, etc?

2 answers

1


The method ->hourly(); runs at the beginning of each hour. 13:00,14:00 etc.

To run at a specific minute there is another method: ->hourlyAt(17);

1

It is based on crontab (for Linux) which runs every minute:

* * * * * cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1

The ->hourly(); is executed every closed system time, based on what is defined in Crontab,

For example when you want to run a script every day at 10:30, just set: ->dailyAt('10:30');

The documentation is quite complete, sometimes a little confusing, follow the link: https://laravel.com/docs/5.7/scheduling

Browser other questions tagged

You are not signed in. Login or sign up in order to post.