Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to run task scheduler in windows 10 with Laravel

I just want to ask how to use it's task scheduling feature on windows machine (my local machine).

I've read it's documentation and I've notice that it's using a Cron.

Any help is truly appreciated.

like image 377
Airmovz Avatar asked Mar 30 '16 09:03

Airmovz


People also ask

How do I run a cron job in Windows 10?

First, in the main window of the Task Scheduler, scroll down until you see your task name. If you used the name “cron,” it should be found toward the top of the list. Right-click the task and select “Run.” Then, go back to your WSL terminal and type in sudo service cron status , and it should say that cron is running.

How do I run a cron job in Laravel?

Activate Laravel Cron Jobs Scheduler Now to activate the scheduled jobs, run the Cron command. Go to your application from the Applications tab, and then to the Cron Jobs Manager.


1 Answers

To run Laravel Scheduler in Windows 10 you need:

  1. Create batch file, like this one and save it:

cd c:\laravel-project\

c:\php5\php.exe artisan schedule:run 1>> NUL 2>&1

  1. Go to Windows 10 Task Scheduler (fast way is press Win+R and enter taskschd.msc).

  2. Click Create basic task, choose When I logon trigger and then choose Start a program -> your .bat file.

  3. Check Open properties dialog option and click Finish.

  4. In task properties click Triggers, then click New and add new trigger Repeat task every - 1 minute.

Now this task will run Laravel scheduler every one minute.

like image 104
Alexey Mezenin Avatar answered Sep 19 '22 16:09

Alexey Mezenin