Oops... sorry for missing this...
Cron jobs... allow you to run a command at a given time or interval.
To edit the cron table (crontab) for root user you would type something like:
sudo crontab -u root -e
..enter password when prompted.
You should now be presented with everyones favourite vi editor. (if you aren't vi-savvy, ask google for help)
A crontab entry has six fields. The first 5 determine *when* your command is to run. The 6th, is the command.
Example:
0 0 * * * /usr/bin/myarchivescript.sh
...which says, run "myarchivescript.sh" at midnight every day.
The five fields are represented as follows:
minute (0-59)
hour (0-23)
day of the month (1-31)
month of the year (1-12)
day of the week (0-6 with 0=Sunday)
An asterisk (*) means - any, or all.
For example, if you specify * for the first (minute) field in the above example, it will attempt to run the script once *every* minute while the hour is still 0.
You can also have the following types of values for the number fields:
*/15 Is treated as ever 15 minutes, hours, days, or months.
Replacing the 15 with another numerical value will change this option.
2,4,6 Treated as an OR, so if placed in the hours, this could mean at 2, 4, or 6 o-clock.
9-17 Treats for any value between 9 and 17. So if placed in day of month this would be days 9 through 17.
Or if put in hours it would be between 9 and 5.
You can *look* at what cron-jobs are set up for root by issuing the following command:
sudo crontab -u root -l
And if you want to run a cron-job for your current user, you use commands such as:
crontab -e
crontab -l
HTH
:o)