Hi, is there a standard hook, to say to the zope server "execute the method Myproduct.mymethod" each day/hour/min ... (like a unix cron) (okay, I could use "brute force" sending an http://...request directly from a cron shell script with telnet host 8080 ...) thanks, Michel -- _/ _/ _/_/_/ _/_/ Michel.Vayssade@UTC.fr Service Informatique _/ _/ _/ _/ T:33/0-3.44.23.49.24 Universite de Technologie _/ _/ _/ _/ F:33/0-3.44.23.46.77 BP 20.529 60205 Compiegne _/_/ _/ _/_/ _ mv@utc.fr __/www.utc.fr/~vayssade____ France
see http://www.zope.org/Members/lstaffor/Xron - aj ----- Original Message ----- From: "Michel Vayssade" <michel.vayssade@utc.fr> To: <zope@zope.org> Sent: Wednesday, January 30, 2002 10:06 Subject: [Zope] cron job in zope
Hi,
is there a standard hook, to say to the zope server "execute the method Myproduct.mymethod" each day/hour/min ... (like a unix cron)
(okay, I could use "brute force" sending an http://...request directly from a cron shell script with telnet host 8080 ...)
thanks, Michel
-- _/ _/ _/_/_/ _/_/ Michel.Vayssade@UTC.fr Service Informatique _/ _/ _/ _/ T:33/0-3.44.23.49.24 Universite de Technologie _/ _/ _/ _/ F:33/0-3.44.23.46.77 BP 20.529 60205 Compiegne _/_/ _/ _/_/ _ mv@utc.fr __/www.utc.fr/~vayssade____ France
_______________________________________________ Zope maillist - Zope@zope.org http://lists.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://lists.zope.org/mailman/listinfo/zope-announce http://lists.zope.org/mailman/listinfo/zope-dev )
(okay, I could use "brute force" sending an http://...request directly from a cron shell script with telnet host 8080 ...)
I use slightly easier form of brute force to get a backup of my app using cron... wget -O ~me/app.zexp "http://zopehost:8080/app/manage_exportObject?download:int=1" I imagine wget could be used to do other things too.... :-) Adam
You can hook into Zope with Python, since it's just a big Python app. It might be best to write a shell script to set up the necessary environment variables (eg ZOPE_HOME and PYTHONPATH) so that you can get Zope to import/run properly, then call a Python script from the shell script. Something like this maybe: ----------------------- #! /bin/sh if [ "$ZOPE_HOME" == "" ] ; then export ZOPE_HOME=/usr/local/zope/a_zope_base fi if [ "$INSTANCE_HOME" == "" ] ; then export INSTANCE_HOME=~/zope/a_zope_instance fi export PYTHONPATH=$ZOPE_HOME/lib/python python $INSTANCE_HOME/Products/yourproduct/yourcronscript.py -------------------------- As far as hooking into Zope goes, it should be the same (or similar) as it is for unit testing. Import Zope, instantiate a Zope app with Zope.app(), and from there you can access Zope objects just like you would in a product. If you want to make requests to certain objects, you can do so with Testing.makerequest. Hope that's some help. HarryW On Wednesday 30 January 2002 9:06 am, Michel Vayssade wrote:
Hi,
is there a standard hook, to say to the zope server "execute the method Myproduct.mymethod" each day/hour/min ... (like a unix cron)
(okay, I could use "brute force" sending an http://...request directly from a cron shell script with telnet host 8080 ...)
thanks, Michel
Harry Wilkinson wrote:
As far as hooking into Zope goes, it should be the same (or similar) as it is for unit testing. Import Zope, instantiate a Zope app with Zope.app(), and from there you can access Zope objects just like you would in a product.
This works best when you're running ZEO, otherwise your Zope can't be executing at the same time as your cron job ;-) cheers, Chris
On Wednesday 30 January 2002 11:52 am, Chris Withers wrote:
Harry Wilkinson wrote:
As far as hooking into Zope goes, it should be the same (or similar) as it is for unit testing. Import Zope, instantiate a Zope app with Zope.app(), and from there you can access Zope objects just like you would in a product.
This works best when you're running ZEO, otherwise your Zope can't be executing at the same time as your cron job ;-)
cheers,
Chris
Ah, fair point :)
Michel Vayssade wrote:
Hi,
is there a standard hook, to say to the zope server "execute the method Myproduct.mymethod" each day/hour/min ... (like a unix cron)
(okay, I could use "brute force" sending an http://...request directly from a cron shell script with telnet host 8080 ...)
Are you familiar with Loren Stafford's Xron product? (see http://www.zope.org/Members/lstaffor/Xron) It may meet your needs. -r
participants (6)
-
Adam Manock -
Andreas Jung -
Chris Withers -
Harry Wilkinson -
Michel Vayssade -
raï¼ burningman.com