Skip to content Skip to navigation

Running Cron

Posted by: 
Topics: 
Tags: 

Reviewed on 2012-05-03

After a successful Drupal install, you will need to setup a cron job to index the site regularly. Site search and RSS aggregation rely on regular site indexing. There are several ways to accomplish this, which are detailed below.

ITS Scheduling Service

The Scheduling Service is now live at https://tools.stanford.edu/cgi-bin/scheduler - it has greatly simplified the process of setting up cron.

  1. Go to the Scheduling Service web page and choose "Create New Job".
  2. For "Command", enter: curl -sS https://www.stanford.edu/path/to/your/drupal/installation/cron.php(See note below on where to find the URL to use for Drupal 7)
  3. "Run this command as this principal": You should enter the cgi principal of the AFS group; that way, anyone in the -admins group of your AFS space can edit the cron job.
  4. Schedule: For most Drupal sites it's sufficient to set it to Every Hour. More active sites can run cron more often, less active sites can run it less often.
  5. Click Save Job
Screenshot of Scheduling Service interface showing a configured cron job

Configuring your cron job

Poor Man's Cron Module

Another solution is to use the Poor Man's Cron module.

Advantages: Reliable, and it's configured from within your Drupal user interface.

Disadvantages: It's one more Drupal module to load, install, configure, and update; it also relies on a page request (any page request) to trigger the cron script.

Drupal 7

While Drupal 7 has poor man's cron functionality built-in, it's still recommended to have the scheduling service run cron for your site instead. A cron key (to prevent others from running cron on your site) is created for your site during installation (it looks like this: cron.php?cron_key=QVAouqsLW1_gxco4K1a4gfebVeOmPuNp7h-mxN3NBvQ) . You can find this key and the full URL to cron.php under "Reports / Status" at admin/reports/status.