如何使用 Laravel 5.1 在 Windows 10 中运行任务调度程序
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/36305146/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to run task scheduler in windows 10 with Laravel 5.1
提问by Airmovz
I just want to ask how to use it's task scheduling feature on windows machine (my local machine).
我只是想问如何在windows机器(我的本地机器)上使用它的任务调度功能。
I've read it's documentation and I've notice that it's using a Cron.
我已经阅读了它的文档,并且注意到它使用的是 Cron。
Any help is truly appreciated.
任何帮助都非常感谢。
回答by Alexey Mezenin
To run Laravel Scheduler in Windows 10 you need:
要在 Windows 10 中运行 Laravel Scheduler,您需要:
- Create batch file, like this one and save it:
- 创建批处理文件,像这样一个并保存它:
cd c:\laravel-project\
cd c:\laravel-project\
c:\php5\php.exe artisan schedule:run 1>> NUL 2>&1
c:\php5\php.exe artisan schedule:run 1>> NUL 2>&1
Go to Windows 10 Task Scheduler (fast way is press
Win+R
and entertaskschd.msc
).Click
Create basic task
, chooseWhen I logon
trigger and then chooseStart a program
-> your.bat
file.Check
Open properties dialog
option and clickFinish
.In task properties click
Triggers
, then clickNew
and add new triggerRepeat task every - 1 minute
.
转到 Windows 10 任务计划程序(快速方法是按下
Win+R
并输入taskschd.msc
)。单击
Create basic task
,选择When I logon
触发器,然后选择Start a program
-> 您的.bat
文件。检查
Open properties dialog
选项并单击Finish
。在任务属性中单击
Triggers
,然后单击New
并添加新触发器Repeat task every - 1 minute
。
Now this task will run Laravel scheduler every one minute.
现在这个任务将每分钟运行一次 Laravel 调度程序。
回答by Быстрый лось
I still did not run the schedule, the solution was just to add / d to the path in
我还是没有运行schedule,解决办法就是在路径中添加/d
cd c:\laravel-project\
in
在
cd /d c:\laravel-project\