The cron command

In the following example, the crontab command shown below will activate the cron tasks automatically on the hour:

0 * * * * wget -O - -q -t 1 http://CRON_URL

http://CRON_URL is replaced with a URL

In the above sample, the 0 * * * * represents when the task should happen. The first figure represents minutes – in this case, on the "zero" minute, or top of the hour. The other figures represent, respectively, hour, day, month and day of the week. A * is a wildcard, meaning "every time." The minimum is every one minute * * * * *.

The rest of the line wget -O - -q -t 1 basically tells the server to request a url, so that the server executes the cron script

Examples

WhenSetting
Every 1 minute * * * * *
Every 15 minutes */15 * * * *
Every 30 minutes */30 * * * *
Every 1 hour 0 * * * *
Every 6 hours 0 */6 * * *
Every 12 hours 0 */12 * * *
Once a day 4 0 * * *
Once a week 4 0 * * 0
Once a month 4 0 1 * *

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

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

Thus, the cron command example above means "ping http://www.example.com/cron.php at the zero minute on every hour of every day of every month of every day of the week."