首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >计划:没有计划的命令可以运行

计划:没有计划的命令可以运行
EN

Stack Overflow用户
提问于 2019-04-04 23:00:40
回答 2查看 446关注 0票数 0

我的app/console/kernel.php中有以下内容:

代码语言:javascript
复制
<?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时,我得到的提示是:“没有预定的命令可以运行。”

我怎么才能修复它?

EN

回答 2

Stack Overflow用户

发布于 2019-04-04 23:04:19

当手动运行它时,您在特定的一分钟内的特定时间运行它。当没有cron匹配该特定分钟时,这将是预期的输出。

通过在crontab中将其定义为

代码语言:javascript
复制
* * * * * php /path/to/artisan schedule:run >> /dev/null 2>&1

您每分钟运行一次,这将在Scheduler有事情要做时触发一个作业。

票数 0
EN

Stack Overflow用户

发布于 2019-04-10 02:09:14

Laravel处于维护模式,计划程序未在维护模式下工作。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/55519189

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档