Moodle Cron Script

Re: Moodle Cron Script

by Justin Hunt -
Number of replies: 0
Picture of Particularly helpful Moodlers Picture of Plugin developers

Hi Daniel

I will make a tutorial on this soon. But to run the cron job minutely, the command that needs to be run is

[path/to/php] [path/to/moodle/admin/cli/cron.php]  >/dev/null

so it might look like this:

/usr/bin/php /var/www/moodle/admin/cli/cron.php >/dev/null

But that is just the command. You need to schedule it to run each minute ideally. And thats the cron part of things. You can do that via cpanel or the command line. 

Using cpanel. 

From the cpanel's "advanced" section choose "cron jobs" and add the job with the command there. Like this:




From the command line

From the command line you open the file that contains all the cron jobs, using the cron job editor thingy. If it is the first time you might be asked which command line editor to use. Nano is the easiest. [good luck]

crontab -e 

 and add something like this:

* * * * * /usr/bin/php /var/www/moodle/admin/cli/cron.php >/dev/null