ok...

A.M. Kuchling amk at amk.ca
Tue Nov 18 09:35:40 EST 2003


On Tue, 18 Nov 2003 16:02:28 +0200, 
	user at domain.invalid <user at domain.invalid> wrote:
> to users as part of a self test. What I am looking for is to specify a
> date and time to run the self tests without interfering with anything
> else i.e. the rest of the logic is not affected. Is this possible?
>
> P.S. Cron can probably do the job, but I am trying to stick to python.

Why impose that last constraint?  It seems much more difficult to write and
debug Python code for cron-like features than to just use cron.  

Would your Python code run as a daemon and wait around until it's time to do
something?  Then what if it crashes?  You'd better implement logging of
errors so that you find out about any problems.  What if the system gets
rebooted?  You'd better write an /etc/init.d script to start your daemon.

It seems much easier to run 'crontab -e' and type in the following:

# Run the test every morning at 1AM
0 1 * * * /home/amk/test.py

--amk




More information about the Python-list mailing list