11/25/2011

Linux Crontab

Crontab is a tool for adding periodic tasks to a specific user. You can edit the crontab with the following command and add your own periodic tasks.
crontab -e
Crontab entry format is as below:
* * * * * [command to be executed]
- - - - -
| | | | |
| | | | +----- day of week (0 - 6) (Sunday=0)
| | | +------- month (1 - 12)
| | +--------- day of month (1 - 31)
| +----------- hour (0 - 23)
+------------- min (0 - 59)
And here is a sample crontab entry:
0 * * * * /bin/ksh /opt/oracle/report/scripthourly.sh
0 * * * * /usr/bin/find /opt/oracle/report/mdsphourly/ -name "*.csv" -ctime +1 -delete

No comments:

Post a Comment