CRON

Posted by alex almazan Sun, 13 Apr 2008 06:21:00 GMT

Cron

Five values are available for scheduling automated processes
minute  hour   day of month  month  day of week                       
0-58    0-23      1-31       1-12     0-7  (0 or 7 is Sun,3 ltr abrvs)
examples

1.) create a cronjob for the user root that checks the amount of availabe space on the system every friday at 12:34 pm

34     12     *     *     5     /bin/df -h >>root.out --to create a file
34     12     *     *     5     df -h 

will mail to crontab user (MAILTO=user to customize)

2.) Create a cronjob as a regular user that lists the contents of /tmp at 4:56 am on Monday,February 3

56 04 3 2 1 /bin/ls -alh /tmp >> /root/tmpspace.out

(this one will run on every monday and on the third. Day of week or day of month get applied when the condition is met) You will have to write the logic in the script or * for every monday or * from just the third