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.

Hii All,

I want to create a python daemon win windows named daemon.py.

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

Also this daemon needs to be running whole the 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
add comment

2 Answers 2

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
add comment

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. (http://cronw.sourceforge.net/) 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
1  
Since when couldn't you specify per-hour activity? You can do per-minute if you'd like: i.imgur.com/hOTYt.png –  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
add comment

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.