Setting Up Cron Jobs

In Drupal, cron jobs are used to schedule and perform various maintenance tasks on your site. Within a Drupal site, cron jobs trigger several important tasks, such as building the search index for your site, and generating and updating log files. Frequently, other modules will also set up actions that are triggered by cron jobs.

The name cron job comes from the Linux utility cron, an automated scheduling program installed on Linux systems. For an overview of cron, visit http://en.wikipedia.org/wiki/Cron.

The easiest way to set up cron jobs is via the Poormanscron module, available at http://drupal.org/project/poormanscron. Download and install this module as described in Chapter 3. Once the module is installed, click the Administer | Site configuration | Poormanscron link, or navigate to admin/settings/poormanscron.

Poormanscron

The configuration options allow you to specify how frequently, in minutes, cron should run. For most learning sites, cron should run every two to three hours. When you are setting up your site and tweaking the configuration options, you should set both Log successful cron runs and Log poormanscron progress to Yes, as this will provide a point of reference that everything is running as it should.

You can also configure cron jobs to run from the command line, and some Web hosting companies have utilities that simplify the creation of cron jobs. For information about setting up cron jobs within different hosting environments, refer to the Drupal handbook at http://drupal.org/cron.

Was this article helpful?

0 0

Post a comment