Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to create a python daemon in windows named

There is a file which is used to take backup. I want to run this file every hour as background process. After one hour this automatically should call and then again after each hour it should do the same.

Also this daemon needs to be running the whole time. If by mistake user deleted this daemon process, it should start automatically & also it should start automatically after the start of the window.

I have tried many cases but not able to yet get the proper code.

Can anyone help me in solving this please?

share|improve this question

As bubu suggests, consider Windows Task Scheduler. While crond is available, Task Scheduler is already there and part of Windows.

Use the Task Scheduler Windows UI to set this up or your script(s) may use the command line. Schedule and manage tasks with the at command.

With TS, schedule your daemon script to execute every hour. There are also settings available that will cause the task to run if it fails.

Good luck.

share|improve this answer

one of the way to do it would be to use the task scheduler in windows. the downside of it is that it is not as flexible as cron daemon in unix. for example, you can't specify per hour activity.

another way of doing it, which i recommend, is to use crond for windows. ( ask here if you have trouble setting it up

EDIT: task scheduler can specify per hour, or even per minute behavior. it's just that i haven't looked hard enough. thanks for pointing out.

share|improve this answer
yes sure i will try and ask you incase problem – sam Dec 15 '10 at 4:16
Since when couldn't you specify per-hour activity? You can do per-minute if you'd like: – John T Dec 15 '10 at 4:16
how can we do that? – sam Dec 15 '10 at 4:32
@John T thanks for pointing out. My bad. – bubu Dec 15 '10 at 4:56

Your Answer


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.