dphs48626 2016-06-02 08:09
浏览 136
已采纳

Windows Server上的Laravel任务计划程序

I am trying to use the Laravel Task scheduler on a windows server but after various research, I can't figure out how to do this.

Obviously I can do this on linux but as I can understand triggering artisan from the windows task scheduler , is not enough.

Could you please help me out on this?

  • 写回答

1条回答 默认 最新

  • dongma1666 2016-08-04 23:54
    关注

    here are the steps you should follow in order to perform the desired task

    • 1 create a .bat file with the next content, I recommend to save this bat file inside a directory into your application folder.
       cls 
       cd C:\xampp\htdocs\ProjectName 
       php artisan schedule:run dir
    
    • 2 you must change C:\xampp\htdocs\ProjectName to the location of
      yout application and then save it.

    • 3 press Windows + R, write Taskschd.msc and press enter

    • 4 left click on Task Scheduler (Local) > click on 'create task'

    • 5 In the 'general' tab write a Name for the task into the Name
      field

    • 6 Check the radio button 'Run whether user is logged on or not'

    • 7 In the tab 'Actions' click on 'New', in the field 'Action' select
      'Start a program'

    • 8 Click on 'browse' and search and select the .bat file you just
      created and the press on 'OK'

    • 9 In the tab 'Triggers' press on 'New'

    • 10 In the Field 'Begin the task' select 'On a schedule'

    • 11 In settings check radio button 'Daily' > in Start set the hour
      to 1:00:00 a.m. > in Recur every set 1 days

    • 12 Into advanced settings check 'Repeat task every' and set [ 5
      minutes +] for a duration of [Indefinitely +]

    • 13 In advanced settings the checkbox 'Enabled' must be checked

    • 14 press OK

    • 15 in the tab 'Settings' you must have the next configurations [/] Allow task to be run on demand [/] Run task as soon as possible after a scheduled start is missed [/] If the task fails, restart every 1 minute [/] Stop the task if it turns longer than 3 days [/] if the running task doesn´t end when requested force it to stop if the task is already running, then the following rule applies [Queue a new instance +]

    • 16 press the OK button, write the user password , and then you
      could start the task if you need

    I hope this to be useful for you.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记
  • ¥15 保护模式-系统加载-段寄存器