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 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
etc. |
etc. |
etc. |
|
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.