如果我运行手动命令,我有一个可以工作的任务调度: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."