Changes between Initial Version and Version 1 of faq/cron-job


Ignore:
Timestamp:
Jan 16, 2008, 2:45:21 PM (16 years ago)
Author:
Jamie McClelland
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • faq/cron-job

    v1 v1  
     1= How do I add a cron job? =
     2
     3A cron job is a command that runs repeatedly at a given time. Often, cron jobs are set to run tasks like updating your web site statistics once an hour, or backup your data every day, or access your Drupal installation's cron.php script on a regular basis.
     4
     5To set a cron job, you will need to access your server using a secure shell program. Please refer to our [wiki:secure_shell secure shell page] for information about how to run secure shell on your computer.
     6
     7Once you have connected via secure shell to your primary server, you can create a cron job by typing:
     8
     9{{{
     10crontab -e
     11}}}
     12
     13After typing this command, a text editor program will open, prompting you to enter your crontab information.
     14
     15The crontab syntax is a series of space separated numbers or asterisks, followed by the command you want to run. For example:
     16
     17{{{
     185 * * * * /usr/bin/curl curl --silent --compressed http://mayfirst.org/cron.php
     19}}}
     20
     21The first five items (in this case: * 5 * * *) refers to when the cron job should be run. The columns are: minute, hour, day of month, month, day of week. An asterisk means always run. So, in the example above, it says, run at 5 minutes after the hour, every hour, every day, every month and every day of the week. Similarly, typing (5 8 * * *) would mean to run at 8:05 every day.
     22
     23Everything after the numbers and asterisks is the command to be run. In this example, it means: access the http://mayfirst.org/cron.php script.