By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,035 Members | 1,384 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,035 IT Pros & Developers. It's quick & easy.

Periodic tasks.

P: n/a
Hi,

I am trying to execute some tasks periodically, those familiar with
unix can think of it as equivalent to cron jobs. I have tried looking
around, but couldn't find a way. Would appreciate any pointers or
clues..

Thanks,
-Ram

May 29 '07 #1
Share this Question
Share on Google+
7 Replies


P: n/a
Ramashish Baranwal <ra*************@gmail.comwrites:
I am trying to execute some tasks periodically, those familiar with
unix can think of it as equivalent to cron jobs.
Can you not use cron? If not, why not? Is there an equivalent service
you can use?
I have tried looking around, but couldn't find a way.
Using the services provided by the operating system would be far
preferable to re-inventing a scheduler service.

--
\ Contentsofsignaturemaysettleduringshipping. |
`\ |
_o__) |
Ben Finney

May 29 '07 #2

P: n/a
I am trying to execute some tasks periodically, those familiar with
unix can think of it as equivalent to cron jobs.

Can you not use cron? If not, why not? Is there an equivalent service
you can use?
I can, but the work I want to do is written in Python. This is not an
issue but I would have more than one such tasks running at different
periods and it will be desirable to control or monitor all of them
from a single process. If I use cron, all of them will execute
independently.
>
I have tried looking around, but couldn't find a way.

Using the services provided by the operating system would be far
preferable to re-inventing a scheduler service.
Agreed, but my requirement is a little different. There is a TaskKit
package (http://webware.sourceforge.net/Webwa.../TaskKit/Docs/
QuickStart.html) that has such a scheduler. Does anyone have any
experience with it?

Ram

May 29 '07 #3

P: n/a
Ben Finney wrote:
Ramashish Baranwal <ra*************@gmail.comwrites:
>I am trying to execute some tasks periodically, those familiar with
unix can think of it as equivalent to cron jobs.

Can you not use cron? If not, why not? Is there an equivalent service
you can use?
>I have tried looking around, but couldn't find a way.

Using the services provided by the operating system would be far
preferable to re-inventing a scheduler service.
Alternatively, the user could make use of the already-existing "sched"
module from the standard library. With a little threading that would do
the job fine.

regards
Steve
--
Steve Holden +1 571 484 6266 +1 800 494 3119
Holden Web LLC/Ltd http://www.holdenweb.com
Skype: holdenweb http://del.icio.us/steve.holden
------------------ Asciimercial ---------------------
Get on the web: Blog, lens and tag your way to fame!!
holdenweb.blogspot.com squidoo.com/pythonology
tagged items: del.icio.us/steve.holden/python
All these services currently offer free registration!
-------------- Thank You for Reading ----------------

May 29 '07 #4

P: n/a
On May 29, 4:39 pm, Steve Holden <s...@holdenweb.comwrote:
Alternatively, the user could make use of the already-existing "sched"
module from the standard library. With a little threading that would do
the job fine.

regards
Steve
--
Steve Holden +1 571 484 6266 +1 800 494 3119
Holden Web LLC/Ltd http://www.holdenweb.com
Skype: holdenweb http://del.icio.us/steve.holden
------------------ Asciimercial ---------------------
Yes. Also, there's an example in the Python Cookbook (print edition)
which is exactly about this - using sched. The recipe before that also
shows how to do it without using the sched library. Both those recipes
are purely in Python.

Vasudev Ram
Dancing Bison Enterprises
www.dancingbison.com
May 29 '07 #5

P: n/a
Ramashish Baranwal wrote:
Hi,

I am trying to execute some tasks periodically, those familiar with
unix can think of it as equivalent to cron jobs. I have tried looking
around, but couldn't find a way. Would appreciate any pointers or
clues..

Thanks,
-Ram

Have a look at Kronos, a simple task scheduler I wrote a while ago,
based on sched. It's part of Turbogears as well:
http://trac.turbogears.org/browser/t...s/scheduler.py
--Irmen
May 30 '07 #6

P: n/a
Steve Howell wrote:
>Thanks. Here are two links, not sure those are
exactly what are being referenced here, but look in
the ballpark:
http://aspn.activestate.com/ASPN/Coo.../Recipe/413137
http://docs.python.org/lib/module-sched.html
You're welcome.

The ActiveState recipe you mention above is not the one I meant,
although it uses sched.
I saw the recipe that I mentioned, in the print version of the Python
Cookbook, when reading it a few days ago.

The second link above you mention is right, its about the sched
library.

Also just found these other recipes in the online Python Cookbook, may
or may not be of help to you:

http://aspn.activestate.com/ASPN/Coo.../Recipe/496800
http://aspn.activestate.com/ASPN/Coo.../Recipe/114644
Vasudev Ram
www.dancingbison.com
May 30 '07 #7

P: n/a
On May 29, 2:33 pm, Ramashish Baranwal <ramashish.li...@gmail.com>
wrote:
Hi,

I am trying to execute some tasks periodically, those familiar with
unix can think of it as equivalent to cron jobs. I have tried looking
around, but couldn't find a way. Would appreciate any pointers or
clues..

Thanks,
-Ram
I googled "twisted cron", if u use twisted, that's maybe help u:
http://svn.zope.org/Zope3/trunk/src/...8967&view=auto
http://twistedmatrix.com/pipermail/t...ne/013525.html

May 30 '07 #8

This discussion thread is closed

Replies have been disabled for this discussion.