Error: “No scheduled commands are ready to run.” in Laravel?

0 votes

I've set up the following Laravel commands:

protected function schedule(Schedule $schedule) {
        $schedule->command('command:daily-reset')->daily();
        $schedule->command('command:monthly-reset')->monthly();
}

Then, on my server, I've set up a cron job to run once per day (at 00:00).

0 0 * * * php /home/privates/public_html/staging/current/artisan schedule:run

My cron job is running successfully each night, but the logs simply say: "No scheduled commands are ready to run."

What am I doing wrong? I would expect my daily command to run each night.

Thanks!

Apr 6 in Laravel by kartik
• 11,290 points
239 views

1 answer to this question.

0 votes

Hello @kartik,

Run php artisan and see if your commands have registered.

If you have registered your commands you should see command:daily-reset and command:monthly-reset under the list of available artisan commands.

If you don't see them there go ahead and register your commands by adding it to commands property available in app/Console/Kernel.php.

protected $commands = [
    'App\Console\Commands\YourFirstCommand',
    'App\Console\Commands\YourSecondCommand'
];

Change crontab entry to

* * * * * php /home/privates/public_html/staging/current/artisan schedule:run

thank you!!

answered Apr 6 by Niroj
• 22,790 points

Related Questions In Laravel

0 votes
1 answer

Error:My Routes are Returning a 404 in Laravel?

Hii @kartik Routes Use them to define specific routes ...READ MORE

answered Mar 30 in Laravel by Niroj
• 22,790 points
164 views
0 votes
1 answer

Error:Failed to open stream: Permission denied in Laravel?

Hii @kartik, To solve permissions issue on Laravel, ...READ MORE

answered Apr 3 in Laravel by Niroj
• 22,790 points
404 views
0 votes
1 answer

What are the important directories used in a common Laravel application

Hey @Kartik. Directories used in a common Laravel ...READ MORE

answered Mar 17 in Laravel by Niroj
• 22,790 points
34 views
0 votes
1 answer

How to pass URL param in Laravel?

Hello, First you have to go to routes ...READ MORE

answered Mar 18 in Laravel by Niroj
• 22,790 points
108 views
0 votes
1 answer

How to make anchor tag with routing using Laravel?

Hey @kartik, First you have to go to ...READ MORE

answered Mar 18 in Laravel by Niroj
• 22,790 points
434 views
0 votes
1 answer

What is type casting and type juggling in php?

Hey, The way by which PHP can assign ...READ MORE

answered Mar 27 in PHP by Niroj
• 22,790 points
52 views
0 votes
1 answer

How can we create a session in PHP?

Hello @kartik, session_start() function is used in PHP to ...READ MORE

answered Mar 27 in PHP by Niroj
• 22,790 points
33 views
0 votes
1 answer

What is the use of $_REQUEST variable in php?

Hii @kartik, The $_REQUEST variable is used to read the ...READ MORE

answered Mar 27 in PHP by Niroj
• 22,790 points
50 views
0 votes
1 answer

Error: Exception file_put_contents failed to open stream: No such file or directory in Laravel?

Hello, You should typically run the php artisan config:cache command ...READ MORE

answered Mar 31 in Laravel by Niroj
• 22,790 points
688 views
0 votes
1 answer

Error:login in Laravel. How to solve?

Hey, First check if your model login has a field password in ...READ MORE

answered Mar 26 in Laravel by Niroj
• 22,790 points
86 views