PHPFixing
  • Privacy Policy
  • TOS
  • Ask Question
  • Contact Us
  • Home
  • PHP
  • Programming
  • SQL Injection
  • Web3.0

Friday, March 11, 2022

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

 March 11, 2022     cron, laravel-5     No comments   

Issue

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?


Solution

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.



Answered By - Nacho
  • Share This:  
  •  Facebook
  •  Twitter
  •  Stumble
  •  Digg
Newer Post Older Post Home
View mobile version

0 Comments:

Post a Comment

Note: Only a member of this blog may post a comment.

Total Pageviews

Featured Post

Why Learn PHP Programming

Why Learn PHP Programming A widely-used open source scripting language PHP is one of the most popular programming languages in the world. It...

Subscribe To

Posts
Atom
Posts
Comments
Atom
Comments

Copyright © PHPFixing