Drupal Cron Configuration

Cron is a time-based scheduler used to run programs automatically on UNIX, Linux and Mac servers. ThetaJoin runs Ubuntu Server LTS, which is a distribution of Linux. Cron calls the wget program to run the cron.php script that's installed along with your Drupal site. This script is used to run automated tasks within Drupal, such as checking for Drupal updates, updating RSS feeds, clearing out logs, possibly sending out emails, etc.

Security

There's one important security aspect in accessing the cron.php script on your ThetaJoin server. For security purposes, ThetaJoin webservers are configured to deny access to the cron.php script from the public internet. As an example, if you try to run cron.php from http://www.thetajoin.com/cron.php, you'll receive a 403 Forbidden error. Having cron.php publically accessible can cause all kinds of havoc to your Drupal website such as excessive database activity, logfiles getting emptied, RSS feeds constantly updating causing you to get blocked from their sources, and even overloading the webserver on your ThetaJoin server. To mitigate this security problem, cron.php can only be called from the localhost. All ThetaJoin servers come preconfigured to run wget every 15 mins, which should be sufficient for most sites.

Configuration

Cron is used to create a "cron job" to call the wget program which accesses the URL http://localhost/cron.php. To access Cron on your ThetaJoin server, login to Webmin, then navigate to the System->Scheduled Cron Jobs page, click on the wget line.

Drupal Hosting Cron Conig

Click on the wget line produces the configuration page for that cron job. Starting from the top, this cron job is executed as the root user, this cron job is active, and the command that cron will run is:

/usr/bin/wget -q -t 1 -O /dev/null http://localhost/cron.php

The wget command has a few commandline arguments:

Under the When to execute area is where this cron job time is set to execute. ThetaJoin servers are configured to run the wget cron job every 15 mins.

Drupal Hosting Cron Configuration

Cron is highly configurable, and is covered in greater detail in the Ubuntu Cron Howto.