首页 > 解决方案 > Laravel 5.4 中的调度程序,Crontab 无法自动工作

问题描述

当我在终端中运行“php artisan schedule:run”时,它运行良好。当我将我的 crontab 配置为自动执行它时,它没有任何效果。Cron 不工作。

内核.php

    $schedule->call(function () {
        Log::info('Cron Started');
        $test=Example::orderBy('updated_at', 'asc')->get();
    })->everyMinute();

我也运行了这个脚本:

   * * * * * cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1

当我crontab -e在 CMD 中使用时

  No crontab for root - using an empty one No modification made

标签: phplaravel

解决方案


推荐阅读