Laravel 5.1 Task Scheduling on Windows

前端 未结 4 2114
感动是毒
感动是毒 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:21

    You need to create a scheduled task that will execute that batch file every minute.

    To do so :

    • Press Win + R and run taskschd.msc

    • In the right panel click Create Basic Task and give it a Name + Description.

    • Click Next and select Start a Program option, then navigate to the batch file and select it. No need to fill the other fields.

    • Select "Open the properties of this task..." and then Finish.

    • On the Trigger tab, you can change between Daily or At Logon (as I do).

      Here is the part that's not documented, open the dropbox and insert 1 using the keyboard, this is the only way to set the repeat time at 1 minute (even if the dropdown doesn't list it).

      Larevel needs the cronjob to run every minute, otherwise it won't work as expected.

      Also check "Indefinitely" to run it forlifetime.

    Hope it helps.

    The Windows Task Scheduler Help is here, if you run into trouble.

提交回复
热议问题