Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How do programs designed for scheduling (e.g. Task Scheduler in Windows, cron in Unix systems) know that it "is time" for them to run a certain scheduled command or script?

I imagine it's not something like a timed function checking the system clock every second or minute. Is there some kind of trigger being activated when a time stamp corresponding to a certain planned task is reached?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

This probably varies between OSes. For cron, the crond manpage indicates that there's a daemon running in the background which activates itself every minute to check if there's a task that needs to be run.

Windows also has a service that does this according to this support page, though I have no idea of its granularity. Its likely it works similarly.

share|improve this answer
    
Hmm, then I guess it does wake up every minute to check if there are any commands or scripts to run. –  Timothy Jan 22 '13 at 14:12

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.