Laravel “No scheduled commands are ready to run.”

后端 未结 13 1237
囚心锁ツ
囚心锁ツ 2020-12-09 08:39

I\'ve set up the following Laravel commands:

protected function schedule(Schedule $schedule) {
        $schedule->command(\'command:daily-reset\')->dai         


        
13条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-09 08:52

    To run the Cron Commands on the local server, follow these steps:

    1. I know you have already mentioned the command in app/console/Kernel.php
    2. Now open the command line, enter "crontab -e"
    3. Edit that file and mention the below code(without quote) to keep running PHP artisan schedule:run in the background

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

    1. Enter "crontab -l" in the command line, it will list running crons

    Done !!

    Now, wait for cron to process your command. Cheers!!

    Reference- https://laravel.com/docs/7.x/scheduling#introduction

提交回复
热议问题