Setup Cron on Ubuntu

.---------------- minute (0 - 59)
|   .------------- hour (0 - 23)
|   |   .---------- day of month (1 - 31)
|   |   |   .------- month (1 - 12) OR jan,feb,mar,apr ...
|   |   |   |  .----- day of week (0 - 7) (Sunday=0 or 7) OR sun,mon..
|   |   |   |  |
*   *   *   *  *  command to be executed

If we want to setup a cron using curl then syntax will be
0 */6 * * * /usr/bin/curl http://SCRIPT_PATH.php
So this cron will run every 4 hours

This script will run every 5 minutes
*/5 * * * * /usr/bin/curl http://SCRIPT_PATH.php

About these ads

About Kapil Chugh

In love with PHP and tweaking WordPress. Hungry for Open Source and new technologies. Honest. God-fearing. Happiest when solving problems.
This entry was posted in Ubuntu and tagged , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s