Windows Server上的Laravel任务计划程序

我试图在Windows服务器上使用Laravel Task调度程序,但经过各种研究,我无法弄清楚 如何做到这一点。</ p>

显然我可以在linux上做到这一点,但我可以理解从Windows任务调度程序触发工匠是不够的。</ p>

你能帮我解决这个问题吗?</ p>
</ div>

展开原文

原文

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?

doutuobao9736
doutuobao9736 查看此论坛发表laracasts.com/discuss/channels/general-discussion/...
4 年多之前 回复

1个回答

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.

Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
立即提问
相关内容推荐