Cron

Cron is a time based UNIX scheduler, and Drupal has its own cron!

Drupal's cron is a bit different from UNIX cron, because it does not involve the system cron.
Since Drupal is a scripting application, it does not reside in memory permanently.    When a page is requested via a Drupal site and the request is served, at the end of the request, Drupal checks to see when cron was last run.  It is has been a while, it runs cron.

What happens when cron is run?  A lot of background maintenance.  If you have aggregator installed, and it is time, the aggregator will run.  Search will update its index.  Drupal update will check for updates, and system functions like clearing the flood table are run with cron.

Configuring Cron

Cron can be configured by going to Admin > configuration (System sub group) > cron or admin/config/system/cron

Drupal Cron System
Cron is located in the System group on the configuration page.

The cron page located at admin/config/system/cron has three primary parts

  • Run cron button
  • Run cron via link
  • When to run cron (Run cron every)

If you want to run cron immediately, just click the button.

Drupal Run Cron
The UI way is usually the best way, click the button!

The second option is via a link.  If you have an external scheduler application that can fetch a URL, this is the URL that you would provide it.

The URL is a link that will run the cron.  You can also see when the last time cron was run via the timestamp.

The third option allows you to setting how often cron is run.  This varies for your site.

Drupal Run Cron Every
The default setting for cron is three hours.

Remember to click the save configuration button at the bottom of the page if you make changes to cron.

DISCLAIMER:

You can royally mess up cron.  If you have an external app that can hit the URL and it hits the URL every hour, and you set cron to run hour, you are basically running cron twice.  Be mindful with cron.