1

如果我运行手动命令,我有一个可以工作的任务调度:php artisan word:weeklyUpdate,但这必须在特定日期自动完成,所以我尝试运行* * * * * cd /var/www/html && php artisan schedule:run >> /dev/null 2>&1,但我得到了Command 'app' not found, did you mean:

内核.php

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

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

更新:sudo php artisan schedule:run得到"No scheduled commands are ready to run."

4

1 回答 1

1

我的案例的命令是:

 * * * * * php -d register_argc_argv=On /var/www/html/artisan schedule:run >> /dev/null 2>&1
于 2020-07-16T13:17:29.013 回答