cron installation

Re: cron installation

by Luis de Vasconcelos -
Number of replies: 0

What happens when you open up a command line window (cmd.exe) and enter:

cd c:\path\to\your\moodle\admin\cli
php cron.php

Does it run the cron?

If you can't get the Scheduled Task to run the \admin\cli\cron.php file then put the command into a batch file and set the Scheduled Task to run the batch file instead of the \admin\cli\cron.php file, like this: 

@echo off
set phpdir=C:\path\to\your\PHP\folder
set moodleclidir=C:\path\to\your\moodle\admin\cli
%phpdir%\php.exe %moodleclidir%\cron.php
echo Cron done!
pause
exit
The nice thing about that is that you can modify it slightly so that it logs the output of the \cli\cron.php script, like this:

@echo off
set phpdir=C:\path\to\your\PHP\folder
set moodleclidir=C:\path\to\your\moodle\admin\cli
%phpdir%\php.exe %moodleclidir%\cron.php >> cron_output.log
echo Cron done!
pause
exit
Then you can read the log file if you need to troubleshoot anything cron related...