0

I'm not quite understanding how the laravel scheduling and schedule:run are working, at least it is not working the way I'd expect it to.

In app/Console/Kernel.php, a command is scheduled to run every five minutes:

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

In expectation of it being run when executing php artisan schedule:run in the console, I only get the No scheduled commands are ready to run. message.

Playing around with it, I found out that defining the schedule as cron('*/2 * * * *') leads to it being executed on every schedule:run call. Changing it to cron('*/15 * * * *') won't run anything, though, even after around 20 minutes.

Is there something I'm doing wrong or am I just using it the wrong way? In my understanding, schedule:run is basically the same command that is configured in the crontab, which is why I'm expecting it to also work by simply calling it in the terminal.

pdu
  • 10,295
  • 4
  • 58
  • 95
  • did you modify your crontab like this `* * * * * php /path-to-your-project/artisan schedule:run >> /dev/null 2>&1` – huuuk May 16 '17 at 12:59
  • I'm talking about calling that one on the command line, locally, while developing/testing. It does not work there. The cron executes the same command AFAIK, so I'd say it won't work there, either. But yes, the crontab looks like this. – pdu May 17 '17 at 07:20

0 Answers0