Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Laravel scheduler says "No scheduled commands are ready to run."

Tags:

cron

laravel-5

I've setup a command like this:

protected function schedule(Schedule $schedule)
{
    $schedule->command('feeds:fetch')->everyFiveMinutes();
}

I've setup a cron job to run php artisan schedule:run

When I run that line on dev's terminal it runs the task OK. On Prod it returns "No scheduled commands are ready to run."

Any way to troubleshoot this?

like image 238
Nacho Avatar asked Mar 20 '15 19:03

Nacho


1 Answers

The fine folks at Larachat (https://larachat.slack.com/) helped me out debug this issue.

The problem was with my crontab. I was setting the crontab to execute the artisan scheduler as follows:

*/1 * * * * php /path/to/artisan schedule:run

(meaning execute every 1st minute of every hour every day.)

When it should be:

* * * * * php /path/to/artisan schedule:run

(meaning execute every minute of every hour every day.)

So, when I manually ran cron on a non-1st minute of every hour, it didn't run at all.

like image 190
Nacho Avatar answered Sep 28 '22 05:09

Nacho