Two usefull command:
crontab -l # list all the crontab task exist
crontab -e # edit this crontab schedule
#(default editor is vi if you want to change modify the VISUAL env variable using comman setenv)
Crontab format : reference from wikepedia
.---------------- 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,tue,wed,thu,fri,sat
| | | | |
* * * * * command to be executed
Examples : execute my backup.sh every day at 2' aclock
0 2 * * * /home/oracle/bin/backup.sh
More examples of format:
#every 5 minutes
*/5 * * * * command to be executed
#from 6 to 12 aclock every 20 minutes
0 6-12/3 * * * command to be execute
#first day every month and monday to friday at 8 and 18 aclock
0 8,18 1 * mon-fri command to be execute
One tip you can use the way followed to edit your contab schedule:
crontab -l>tmp
vi tmp
crontab tmp