Computing.Net > Forums > Unix > crontab problem

crontab problem

Reply to Message Icon

Original Message
Name: erez321
Date: October 13, 2004 at 11:40:48 Pacific
Subject: crontab problem
OS: sun os
CPU/Ram: ttt
Comment:

when i update a crontab job and then update the clock with "date" the crontab job doesn't start. I need to update the crontab after updating the system clock inorder it to be activated.
Does anyone knows why? and how to solve it?
btw it works aswell if i change the time and then restart the cron service


Report Offensive Message For Removal

Response Number 1
Name: Don Arnett
Date: October 13, 2004 at 11:59:51 Pacific
Subject: crontab problem
Reply: (edit)

My guess, after thinking about how I would implement cron, is:

when you save the crontab file, cron finds the next time that one of the scheduled items should occur and the sets an alarm to go off at that time, then cron goes to 'sleep' waiting for the alarm.

This way cron doesn't have to waste a lot of cpu cycles checking each second seeing if something needs to run.


This implementation would explain both of your problems.

If you update the clock after updating crontab, cron has already set a timer, so it doesn't recognize the changed time. If you update the timer, then crontab, cron will set the timer based upon the new time. If you restart the cron server, it resets a time for the next entry.

Just an educated guess.


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: crontab problem

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software