Search code examples
laravellaravel-7laravel-scheduler

Run Task Scheduling, Laravel


I have a Task Scheduling with works if I run the manual command : php artisan word:weeklyUpdate , but this must be done automatilcally on a specific date, so I tried to run * * * * * cd /var/www/html && php artisan schedule:run >> /dev/null 2>&1 but I get Command 'app' not found, did you mean:

Kernel.php

protected function schedule(Schedule $schedule)
{
    $scheduler = new LkpSchedulerUpdateDate;
    $scheduler = $scheduler->first()->toArray();

    $schedule->command('word:weeklyUpdate')->weeklyOn($scheduler['date'], $scheduler['time']);
}

UPDATE: ON sudo php artisan schedule:run I get "No scheduled commands are ready to run."


Solution

  • The command for my case was:

     * * * * * php -d register_argc_argv=On /var/www/html/artisan schedule:run >> /dev/null 2>&1