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 - Ignacio Answer Checked By - Terry (WPSolving Volunteer)