Community Documentation

Set up cron

Last updated April 30, 2012. Created by laura s on April 25, 2008.
Edited by webchick, arianek, jhodgdon, add1sun. Log in to edit this page.

Configuring cron is an extremely important task in your Drupal website setup. Search module's indexing of your website's content, Aggregator module's retrieval of feeds, Ping module's notification of other sites of updates, and System module's routine maintenance tasks, such as pruning of logs, all depend on a properly configured cron job.

What is a cron job?

Many Drupal modules have tasks that have to take place from time to time. Think of cron as the tolling of a bell, letting Drupal know that it should perform the appropriate tasks.

The actual "cron job" is a time-triggered action that is usually (and most efficiently) performed by your website's hosting server, but can also be configured by a remote service or even from your own desktop.

For your Drupal site, what actually happens is that the cron job triggers an invisible visit to the site's cron.php file (http://www.example.com/cron.php) which, in turn, executes tasks on behalf of installed modules.

Triggering Drupal cron without a cron job

With the inclusion of "Poor man's cron" in the Drupal 7 core, it is no longer necessary to set up a cron job on your web server. Instead, you can configure the frequency with which cron is run on admin/config/system/cron (Administration > Configuration > System > Cron). Cron will then be triggered by end users visiting your site. (You can also disable this functionality entirely for performance here, by setting the "Run cron every" value to "Never" or setting $conf['cron_safe_threshold'] = 0 in settings.php.)

In Drupal 6, you can achieve the same functionality by installing the contributed Poormanscron module.

Comments

I use my Buffalo WHR-HP-G54 with tomato 1.27 firmware to trigger cron on my drupal websites. I made a short tutorial which you can find on my website

http://www.adamkowalewski.com/cron-job-drupal-6.html

cya
Adam

Nice tip! I use a WRT54GL

Nice tip! I use a WRT54GL with the Tomato firmware, and this is an awesome tip for my local dev site crons, thanks!

A third party cron trigger

If you want to use a third party cron trigger, you may try http://www.easycron.com.

There is Drupal module "EasyCron" (http://drupal.org/project/EasyCron) which makes configuring the cron job easier for you.

It would be helpful if this page were revised to explain why you might want to use a true, external cron job rather than the "internal" poor man's version (/admin/config/system/cron in Drupal 7).

After spending 15 minutes googling around, it appears that the external cron is "more efficient". How? How much? What functionality has its performance affected?

nobody click here