Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!nntp.club.cc.cmu.edu!micro-heart-of-gold.mit.edu!bloom-beacon.mit.edu!bloom-beacon.mit.edu!panix!gordon From: John Gordon Newsgroups: comp.lang.python Subject: Re: Is there a way to schedule my script? Date: Wed, 17 Dec 2014 19:41:33 +0000 (UTC) Organization: PANIX Public Access Internet and UNIX, NYC Lines: 32 Message-ID: References: NNTP-Posting-Host: panix3.panix.com X-Trace: reader1.panix.com 1418845293 5596 166.84.1.3 (17 Dec 2014 19:41:33 GMT) X-Complaints-To: abuse@panix.com NNTP-Posting-Date: Wed, 17 Dec 2014 19:41:33 +0000 (UTC) User-Agent: nn/6.7.3 Xref: csiph.com comp.lang.python:82607 In Juan Christian writes: > --047d7b874b2c1e67eb050a6e3cc4 > Content-Type: text/plain; charset=UTF-8 > I know about the schedule modules and such but they work in situations like > 'run this in a X hours/minutes/seconds interval', I already have my code in > a while loop with sleep (it's a bit ugly, I'l change to a scheduler soon). > What I really want is, for example: > 24/7/365 > 9:00 AM -> Start > 11:59 PM -> Stop > 9:00 AM ~ 11:50 PM -> Running > 12:00 AM ~ 8:59 AM -> Stopped > I want my script to start at a given time and stop at another given time, > is that possible? You could write a separate program whose only job is to send a STOP or CONTINUE signal to your main program, and then run that program from a scheduler. The standard system "kill" command would probably work for this purpose, assuming you have access to your main program's process ID. -- John Gordon Imagine what it must be like for a real medical doctor to gordon@panix.com watch 'House', or a real serial killer to watch 'Dexter'.