我的app/console/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->command('inspire')
// ->hourly();
$schedule->command('telescope:prune')->daily();
$schedule->command('synergy:sync')->everyMinute();
}
/**
* Register the commands for the application.
*
* @return void
*/
protected function commands()
{
$this->load(__DIR__.'/Commands');
require base_path('routes/console.php');
}
}我在我的crontab中添加了:
/usr/bin/php /home/admin/web/domain.com/public_html/artisan调度:运行
当我在控制台中运行php artisan schedule:run时,我得到的提示是:“没有预定的命令可以运行。”
我怎么才能修复它?
发布于 2019-04-04 23:04:19
当手动运行它时,您在特定的一分钟内的特定时间运行它。当没有cron匹配该特定分钟时,这将是预期的输出。
通过在crontab中将其定义为
* * * * * php /path/to/artisan schedule:run >> /dev/null 2>&1您每分钟运行一次,这将在Scheduler有事情要做时触发一个作业。
发布于 2019-04-10 02:09:14
Laravel处于维护模式,计划程序未在维护模式下工作。
https://stackoverflow.com/questions/55519189
复制相似问题