Getting To Know Cron

The cron feature in Drupal is an important Drupal feature that you should really get to know.

What Is Cron?

Cron is a php script that activates features that need to be run on a periodic basis. If you look at the files for the core install of Drupal you will notice a file called cron.php. That is the file you execute when you run cron.

Why You Should Use Cron

Cron allows you to take advantage of some other important Drupal features and modules. The core search module uses cron to to index the terms included in content nodes so that they will show up in the search results when users search for them. The automatic module and theme update notifications in Drupal 6 use cron to check drupal.org for updates. The core news aggregator uses cron to check for updated news feeds. Other contributed modules use cron as well.

How You Can Run Cron

There are three ways that you can run cron.

  1. Execute the file. You can run cron on your Drupal site by going to www.yoursite.com/cron.php. You can also find a direct link to run cron in the admin area of your drupal site at /admin/reports/status.
  2. Use the Poor Man's Cron module. Poormanscron will execute cron automatically when someone visits one of the pages on your site. Poormanscron works by checking, "to see if the last cron run was more than 1 hour ago (this period is configurable). If so, the cron hooks are executed..."
  3. Setting up a cron job on your web server. This method is a bit complicated for basic web users, but some web hosts provide the ability to set up cron jobs via graphical interfaces that make it easy. The cron page on drupal.org provides more info on setting up a cron job with your web host.

Start Using Cron Today

If you're using any of the modules I mentioned above then you should automate the execution of cron today. There's no need for you to have to take the time to remember to run the script manually. And now that you'll have one less thing to remember you can focus on getting better at Drupal and improving the presentation and features on your site.

Bookmark and Share Bookmark Post

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <span> <img>
  • Lines and paragraphs break automatically.
  • Images can be added to this post.

More information about formatting options