Re: ANN: kronos, a task scheduler

From: Irmen de Jong (irmen_at_-nospam-remove-this-xs4all.nl)
Date: 05/22/04


Date: Sat, 22 May 2004 13:36:38 +0200

Michele Simionato wrote:

> I havent't looked at the code it is unclear to me if kronos is a kind of daemon
> or not: what happens if I reboot my machine? Is it enough to restart kronos
> in some init script to get the scheduled task to be executed at the right
> times or is it more complicate than that?

Kronos is not a daemon in the "crond" sense.
When started, it runs as a separate thread or process alongside your
own program. It doesn't store or remember the scheduled tasks by itself.
It shouldn't be too hard to make some sort of persistent task definition
(a "kronostab" if you will) and a little bit of extra code that reads
this definition at startup.

Perhaps it is a nice idea to add a feature to kronos that it can store
the scheduled tasks by itself, so that if it is restarted, it re-reads
the previous schedule file and continues where it left off.
However, this may not be possible because the scheduled tasks contain
references to Python functions (or callable objects) that will be called
when the task is due, and those objects plus their environment will
have to be reconstructed too...

Because kronos uses the standard Python "sched" module, it will still
execute the tasks at the correct times because the task is remembered
by an absolute time value (i.e. 'next task is saturday may 22, 22:00').

I just discovered two possible problems with the code that I posted:
it should have thread locking around the scheduler's queue if you use
a separate thread for the scheduler, and want to change the queue after
the scheduler is started.
The second issue is that you cannot change the queue after you
started the scheduler, if using a separate process for the scheduler.

Bye!

--Irmen de Jong.



Relevant Pages

  • Re: ANN: kronos, a task scheduler
    ... >> I havent't looked at the code it is unclear to me if kronos is a kind of daemon ... It doesn't store or remember the scheduled tasks by itself. ... > a separate thread for the scheduler, and want to change the queue after ... > the scheduler is started. ...
    (comp.lang.python)
  • Re: Windows task scheduler keeps stopping
    ... Can you start the Task Scheduler service in Service Control Manager? ... Can the batch files run scheduled on other machines? ... scheduled tasks under all users, ... Microsoft Online Partner Support ...
    (microsoft.public.windows.server.general)
  • Re: wake from standby for scheduled task?
    ... wake up to run ... "Wake" option in the task scheduler applies to desktops or ... If the computer has been set to Hibernate, ... automatically starting your computer to run scheduled tasks. ...
    (microsoft.public.windowsxp.basics)
  • Re: Problem with Tweak UI to Bypass XP Log On
    ... Running Scheduled Tasks without a password: ... Limit local account use of blank passwords to console logon only. ... Troubleshooting the Task Scheduler ... Now> every time I start up my computer I get a Log On Message> forcing me to enter my password as if I had never set up> TweakUI. ...
    (microsoft.public.windowsxp.customize)
  • Re: scheduled task in xp home
    ... > Thank you for your time spent on this,read those articles and many ... >> Task Scheduler jobs stop running in Windows XP ... >> Scheduled tasks do not run after you install Windows XP Service Pack ... some help on the command line to run a scan. ...
    (microsoft.public.windowsxp.newusers)