I'm guessing that AJ's solution is the best to implement. <br><br>What I did to solve this problem is simply create a few crons on the server that each do a mechanize (<a href="http://wwwsearch.sourceforge.net/mechanize/">http://wwwsearch.sourceforge.net/mechanize/</a>) http call to a specific location in Zope which basically acts as a private API: when called, it executes a function that triggers whatever needs to happen. I hard-coded a check that the source IP must be the specific internal address of the server Zope runs on. That way I know that the functions can't be called from the outside.<br>
<br>Not the best solution, and I wouldn't really recommend it to someone else, but it's easy and it works for me.<br><br>- Thibaud<br><br><div class="gmail_quote">On Mon, Feb 16, 2009 at 12:50 PM, Thierry Florac <span dir="ltr"><<a href="mailto:thierry.florac@onf.fr">thierry.florac@onf.fr</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Le lundi 16 février 2009 à 16:59 +0100, Marco Bizzarri a écrit :<br>
<div class="Ih2E3d">> Hi all.<br>
><br>
> A little of background, before.<br>
><br>
> I need to run some tasks, inside a zope environment, in a periodic<br>
> way. Even though I could resort to using cron and wget, I do not like<br>
> the solution too much, also because it requires me to rely on<br>
> something completly external to the application to schedule the task<br>
> itsel (I need to update the cron to change how often a job is run...<br>
> ).<br>
><br>
><br>
> Now, I can see I can run a task using zopectl run + a script. My<br>
> script would therefore be something like:<br>
><br>
> while True:<br>
> do something<br>
> sleep(for sometime)<br>
><br>
><br>
> of course, there are dozen of ways to write this in a better way, but<br>
> that is not the problem. My problem is understanding if it is possible<br>
> to run such a script via the zdaemon. Can anyone shred some light on<br>
> this topic?<br>
<br>
<br>
</div>Hi,<br>
<br>
I don't know if it's the best way, but I've implemented a "cron like"<br>
task base class for my Zope-2.9 instance, which :<br>
- is thread based<br>
- can launch operations in a "cron like" way<br>
- can act as the user of your choice.<br>
<br>
It doesn't actually provide any user interface to define task<br>
scheduling, but the main base class could probably be used as a good<br>
starting point ; at least, it works ;-).<br>
I can send you the source code on request...<br>
<br>
<br>
Thierry Florac<br>
<font color="#888888">--<br>
Chef de projet intranet/internet<br>
Office National des Forêts - Département Informatique<br>
2, Avenue de Saint-Mandé<br>
75570 PARIS Cedex 12<br>
Mél : <a href="mailto:thierry.florac@onf.fr">thierry.florac@onf.fr</a><br>
Tél. : +33 01.40.19.59.64<br>
Fax. : +33 01.40.19.59.85<br>
</font><div><div></div><div class="Wj3C7c"><br>
_______________________________________________<br>
Zope maillist - <a href="mailto:Zope@zope.org">Zope@zope.org</a><br>
<a href="http://mail.zope.org/mailman/listinfo/zope" target="_blank">http://mail.zope.org/mailman/listinfo/zope</a><br>
** No cross posts or HTML encoding! **<br>
(Related lists -<br>
<a href="http://mail.zope.org/mailman/listinfo/zope-announce" target="_blank">http://mail.zope.org/mailman/listinfo/zope-announce</a><br>
<a href="http://mail.zope.org/mailman/listinfo/zope-dev" target="_blank">http://mail.zope.org/mailman/listinfo/zope-dev</a> )<br>
</div></div></blockquote></div><br>