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.