Cron: Difference between revisions
No edit summary |
|||
Line 1: | Line 1: | ||
{{Installing Moodle}} | {{Installing Moodle}} | ||
The Moodle 'cron' process is a script that | The Moodle 'cron' process is a PHP script (part of the standard Moodle installation) that must be run regularly in the background. The Moodle cron script runs different tasks at differently scheduled intervals. | ||
'''IMPORTANT: Do not skip setting up the cron process on your server for your Moodle. Your site will not work properly without it''' | '''IMPORTANT: Do not skip setting up the cron process on your server for your Moodle. Your site will not work properly without it''' | ||
A cron | A special program (typically called - not surprisingly - 'cron') is used to run the Moodle cron script at a regular interval. The Moodle cron script runs tasks include sending mail, updating Moodle reports, RSS feeds, activity completions, posting forum messages and other tasks. Since different tasks have different schedules, not every task will run in Moodle when the cron script is triggered. | ||
The cron program (that runs the Moodle script) is a core part of Unix based systems (including Linux and OSX) being used to run all manner of time-dependent services. On Windows a special program will usually need to be installed. On shared hosting, you should find the documentation (or ask support) how cron is configured. | |||
Essentially, the task involves adding a single command to the list of cron activities on your system. On Unix based systems this list is a file called a 'crontab' which all users have. | |||
== Setting up cron on your system == | == Setting up cron on your system == |
Revision as of 09:28, 17 May 2012
The Moodle 'cron' process is a PHP script (part of the standard Moodle installation) that must be run regularly in the background. The Moodle cron script runs different tasks at differently scheduled intervals.
IMPORTANT: Do not skip setting up the cron process on your server for your Moodle. Your site will not work properly without it
A special program (typically called - not surprisingly - 'cron') is used to run the Moodle cron script at a regular interval. The Moodle cron script runs tasks include sending mail, updating Moodle reports, RSS feeds, activity completions, posting forum messages and other tasks. Since different tasks have different schedules, not every task will run in Moodle when the cron script is triggered.
The cron program (that runs the Moodle script) is a core part of Unix based systems (including Linux and OSX) being used to run all manner of time-dependent services. On Windows a special program will usually need to be installed. On shared hosting, you should find the documentation (or ask support) how cron is configured.
Essentially, the task involves adding a single command to the list of cron activities on your system. On Unix based systems this list is a file called a 'crontab' which all users have.
Setting up cron on your system
Choose the information for your server type:
- Cron with Unix or Linux- Cron services on various UNIX and Linux flavored operating systems.
- Cron with Windows OS - Cron services in Windows
- Apple OSX - use the built-in 'crontab' service which is exactly the same as Cron with Unix or Linux. However, you might want to do it the 'Apple way' using launchd - see Cron with MAC OS X
- Cron with web hosting services- Cron services in various web hosting examples.
Here are some more instructions for specific hosts (please check that these are up to date):
Cron settings in Moodle
There are settings within Moodle that control aspects of cron operation:
- Cron settings - Moodle cron process password and CLI settings
Remote cron
Using the 'web based' version of cron it is perfectly ok to place the cron process on a different machine to the Moodle server. For example, the cron service on a Unix server can invoke the cron web 'page' on a Windows based Moodle server.
See also
Using Moodle forum discussions:
- Cron - can someone give me a quick confirmation of function?
- Cronjob Question
- Slow cron : avoiding simultaneous cron
- Visibility of cron.php
- How to log the output of a Scheduled Task on Windows - this discussion explains a nice trick that can be very useful when you are experiencing problems with your Windows Scheduled Task and you need to log the output of the Scheduled Task to a log file.