Apr 12

Cron can appear to be challenging at first, but with the proper help, you will find it easy and very helpful to automate tasks on your website.

Cron is simply a way to run any program/script on your web hosted account once a day, once a week, once a month, every Tuesday and Thursday, etc.

It is helpful in automatically performing web site maintenance, automating scripts that generate new sales/coupons/etc.  It can even help establish a back routine for your web site.

Cron is composed of five fields.  The following chart details each field.

Minute Hour Day of Month Month Day of Week
0 = 0

Such as in 1:00

1 = 1

Such as in 1:01etc.

* = Every Hour
0 = 12am
1 = 1am
2 = 2am
12 = 12pm
13 = 1pm

etc.

* = Every Day of the Month
1 = 1st Day of the Month

etc.

* = Every  Month
1 = Jan
2 = Feb

etc.

* = Every Day
0 = Sunday
1 = Monday
2 = Tuesday
3 = Wednesday
4 = Thursday
5 = Friday
6 = Saturday

Common examples include…

  minute hour day of month month day of week
To perform a daily task at 2 am 0 2 * * *
To perform a weekly task on Sunday at 2 am 0 2 * * 0
To perform a monthly task on the 1st of each month at 2 am 0 2 1 * *
To perform a task each Tuesday AND Friday at 2 am 0 2 * * 2,5

The following chart indicates what each number or symbol represent.

Please note:

  • Set the cron to perform the task ONLY as frequently as you expect you need the task to be performed.
  • Do NOT set the cron to perform something everyday and that only needs to be done once a month or every other week.  This wastes valuable CPU time for your website and for others.  

  • Digg
  • Facebook
  • Google Bookmarks
  • Live
  • Sphinn
  • del.icio.us
  • StumbleUpon
  • Mixx
  • Technorati
  • Slashdot
  • email
  • Print
  • Twitter

Related posts:

  1. WP-o-Matic problem running cron job After installation you’ll have to change cron.php if you want...
  2. Gmail knocked offline Google’s Gmail service has been knocked offline for much of...
  3. Regedit as System account run regedit.exe under SYSTEM account. Simple way to run something...
  4. iTunes store finally puts some movies on sale Aiming to convert physical DVD bargain hunters to digital copy...
  5. US Xbox 360 price drop coming this Sunday The evidence appears to be in and it looks like...

written by TMP \\ tags: ,


Comments are closed.

Bad Behavior has blocked 154 access attempts in the last 7 days.