Thursday, January 26, 2012

Unix Cron Scheduling

1. Logfile
The log files for cron daemon can be found under any of the following file
/var/log/cron
/var/log/syslog


2. View/List Cronjobs
$ crontab -l

3. Schedule Cronjobs
a. Create the cronjob entries as mentioned in Step-4 in a textfile (cron_jobs.txt).
b. Run the following command
$ crontab cron_jobs.txt

4.Linux Crontab Format

MIN HOUR DOM MON DOW CMD
Table: Crontab Fields and Allowed Ranges (Linux Crontab Syntax)
FieldDescriptionAllowed Value
MINMinute field0 to 59
HOURHour field0 to 23
DOMDay of Month1-31
MONMonth field1-12
DOWDay Of Week0-6
CMDCommandAny command to be executed.


Reference:
http://www.thegeekstuff.com/2009/06/15-practical-crontab-examples/


No comments:

Post a Comment