Laravel 5.1 Task Scheduling on Windows

前端 未结 4 2122
感动是毒
感动是毒 2021-02-11 06:45

I\'m trying to get Laravel 5.1 Task Scheduling working on IIS. When I run a batch file using Windows task manager it will run the task one time only. How can I get ->everyMinute

4条回答
  •  南旧
    南旧 (楼主)
    2021-02-11 07:26

    Take a look at the task scheduler doc.

    Starting The Scheduler

    Here is the only Cron entry you need to add to your server:

    * * * * * php /path/to/artisan schedule:run >> /dev/null 2>&1

    This Cron will call the Laravel command scheduler every minute. Then, Laravel evaluates your scheduled tasks and runs the tasks that are due.

    In your case, you use the Windows task scheduler instead of Cron but the important thing is to call artisan schedule:run every minute. Each time this command is run, it checks its schedule and runs the due tasks/commands added.

    artisan schedule:run does not start a long-running process that stays alive to runs tasks until you kill it. As I said, it needs to be called every minute.

提交回复
热议问题