*UPDATE* Windows Cron job

*UPDATE* Windows Cron job

by Austin Gatlin -
Number of replies: 2

Here is how to configure cron job on Windows 10, IIS10. 

I created a batch file with the following command line (without quotes) "C:\PHP\v7.0\php-win.exe -f C:\path to moodle installation\admin\cli\cron.php". 

Then I used the Windows Task Scheduler to run the batch file every day at 5 minute intervals.


The reason I am posting this is because the current directions in the documentation is peculiarly wrong for Windows users. The scheduler does not recognize and cannot correctly execute the argument "-f C:\path to moodle installation\admin\cli\cron.php". And the same problem for the Wget option. 

Please consider looking into this and updating the documentation.

Thank you for reading and I hope I have helped someone.

Best regards,

Austin K. Gatlin

Average of ratings: -
In reply to Austin Gatlin

Re: *UPDATE* Windows Cron job

by Patty Lozano -
Hi, I am trying trying to add this but I getting a operation code of 2. Does it matter where you add the bat file?


Thank you,

Patty

In reply to Patty Lozano

Re: *UPDATE* Windows Cron job

by Luis de Vasconcelos -

Is there a specific error message? "operation code of 2" doesn't mean much.

Use php.exe instead of php-win.exe for batch files.

It shouldn't matter where you put the batch file, as long as you specify the full paths to the directories, executables and .php files in the batch file. Even better, create environment variables pointing to your PHP and Moodle installation paths and use those environment variables in the .bat file.