omg, a talking sausage.

Drupal Cron Job Setup Howto on Linux

Cron is a time-based job scheduler in Unix-like computer operating systems. 'cron' is short for 'chronograph'.

If you would like to set up your Drupal and linux server to use the cron, these steps will help to achieve your goal.

Open up a console and change to the user which will run the cron.
Every user has it's own cron tab (which is the list of jobs cron has to run.)
If you prefer, create a new user for this job.

To access your crontab use the following command:

crontab

This will give you a summary of crontab's commands and switches.

To list your cronlist type:

crontab -l

and to edit the list:

crontab -e

If this is the first time you edit the crontab, it will ask you which editor you would like to use.
If you are unsure, use google to find out which editor is the best for you.

Inside the editor, add the following line to the end of the list:

*/5 * * * * /usr/bin/wget -O - -q -t 1 http://[your server url]/cron.php

This will execure the cron.php in every 5 minutes.

Here is a diagram of the general crontab syntax, for illustration:


*    *    *    *    *  [command to be executed]
|    |    |    |    |
|    |    |    |    +----- day of week (0 - 6) (Sunday=0)
|    |    |    +------- month (1 - 12)
|    |    +--------- day of month (1 - 31)
|    +----------- hour (0 - 23)
+------------- min (0 - 59)

* in the value field above means all legal values as in braces for that column.
The value column can have a * or a list of elements separated by commas. An element is either a number in the ranges shown above or two numbers in the range separated by a hyphen (meaning an inclusive range).

By default cron jobs sends a email to the user account executing the cronjob. If this is not needed put the following command At the end of the cron job line .

>/dev/null 2>&1

Read more:
http://drupal.org/cron
http://www.adminschoice.com/docs/crontab.htm

Comments

Post new comment

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

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.