Here is a typical crontab entry and the definition of cron fields:
00 03 * * * /tmp/zing.sh
- minute (00-59)
- hour (00-23)
- day of the month (01-31)
- month of the year (01-12)
- day of the week (0-6 with 0=Sunday)
- program or command to run
Ranges (X-Y) and steps (X-Y/Z) can also be defined.
Special @reboot option
Recent versions of cron support @reboot instead of time and day settings to run a command after boot. For example:
@reboot /usr/bin/command-to-run
I am not sure if I like this option, compared to using system start up scripts, like /etc/rc.d/rc.local.
User crontabs (including the root user)
To edit a user crontab (including root):
crontab -e
To delete a crontab:
crontab -r
User crontabs are stored as text files in /var/spool/cron/.
System crontab
The system crontab is stored in /etc/crontab. It can be changed (as root) with a text editor.
The system crontab has one extra field before the program to run, which is the user to run the command as (usually root).