Back

Scheduler not working: No scheduled commands are ready to..


Mirkin posted 3 months ago

My Laravel scheduler don't work anymore, this is my kernel.php:

<?php

namespace App\Console;

use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;

class Kernel extends ConsoleKernel
{
    /**
     * The Artisan commands provided by your application.
     *
     * @var array
     */
    protected $commands = [
        //
    ];

    /**
     * Define the application's command schedule.
     *
     * @param  \Illuminate\Console\Scheduling\Schedule  $schedule
     * @return void
     */
    protected function schedule(Schedule $schedule)
    {
        $schedule->exec('echo "Done!"')->everyMinute()->appendOutputTo(storage_path('logs/Schedule.log'))->emailOutputTo('[email protected]');
        // $schedule->command('inspire')
        //          ->hourly();
        $schedule->command('telescope:prune')->daily();
        $schedule->command('synergy:sync')->everyMinute()->appendOutputTo(storage_path('logs/SynergySync.log'))->emailOutputTo('[email protected]');
    }

    /**
     * Register the commands for the application.
     *
     * @return void
     */
    protected function commands()
    {
        $this->load(__DIR__.'/Commands');

        require base_path('routes/console.php');
    }
}

I had added in my crontab:

* * * * * cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1

With the correct path ofcourse..

When I run the command:

php artisan schedule:run

I've got the following output:

No scheduled commands are ready to run.

Is there a way to debug the scheduler? On an other Laravel project on the same server the scheduler works..


Sign in to participate in this thread!



We'd like to thank these amazing companies for supporting us