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.

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

报告相同问题?

悬赏问题

  • ¥60 求一个简单的网页(标签-安全|关键词-上传)
  • ¥35 lstm时间序列共享单车预测,loss值优化,参数优化算法
  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图