| | 98 | 3.7 Cron Tasks |
|---|
| | 99 | Several of the tass that Elgg performs occur automatically, but need to be run on a regular schedule (e.g. importing of RSS feeds should occur every 15-30 min). Several 3rd party plugins also use this functionality (e.g. mailblogger, filecrawler, others). To ensure that this happens, all time-sensitive tasks get bundled together and executed by a single file (cron.php, which sits in the elgg main directory). |
|---|
| | 100 | |
|---|
| | 101 | This file needs to be executed on a regular basis to have the tasks run. There are several ways to accomplish this: |
|---|
| | 102 | Setup a cron task Unix/Linux systems include a system utility that performs tasks at a set interval (this system is called cron - hence the name of the file cron.php). With Linux or Unix you schedule your cron jobs by setting up what's called a "crontab." Note: Hosting providers often give a simplified interface to this via CPanel or PLESK that can make setting up your cron jobs easier.) |
|---|
| | 103 | Your crontab might look like this: |
|---|
| | 104 | 30 * * * * /usr/bin/lynx -source http://yourelggsite.com/cron.php or 30 * * * * /usr/bin/wget -O - -q http://yourelggsite.com/cron.php |
|---|
| | 105 | On Windows servers, comparable tasks can be setup using the Windows scheduler to launch a web browser to open the http://yourelggsite.com/cron.php file every 30 minutes. |
|---|
| | 106 | Alternative For hosts where setting up cron tasks is not possible, you can also use one of many web services (many free) that will execute this file (http://yourelggsite.com/cron.php) on a schedule. One such free service is found at http://www.cronjobs.org/ |
|---|
| | 107 | Frequency The frequency with which you execute cron.php is up to you. Recommended values are every 5-30 minutes. Plugins that use this method to execute tasks may (usually do) set their own "maximum frequency" so that they aren't executed needlessly. |
|---|
| | 108 | |
|---|
| | 109 | |
|---|
| | 110 | |
|---|