Re: [Zope] Packing data.fs programmatically
Ron Bickers wrote: What's the solution without ZEO and without having to stop Zope? You use ZEO. Get over it, it should be how a standard Zope instance is set up, IMNSHO... So, in other words, there isn't one. I take it you're a big fan of ZEO. ;-) I guess I'll check it out. I've been using Zope for 7-ish years and just never bothered. Well exactly. ZEO is not only for scaling Zope to multiple app serving clients, it's the way that ZODB allows multiple processes to access a single database. Think of it in the same way as you'd thing of something like MySQLDB, psycopg or DCOracle2... cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Packing data.fs programmatically
On Fri February 24 2006 16:19, Chris Withers wrote: > >> URL whacking is evil and must be punished... > > > > How is this different than clicking on the Pack button in the ZMI? > > That's also evil, because yes, it is just URL whacking with a browser... Ok. So there is no difference. > > What's > > the solution without ZEO and without having to stop Zope? > > You use ZEO. Get over it, it should be how a standard Zope instance is > set up, IMNSHO... So, in other words, there isn't one. I take it you're a big fan of ZEO. ;-) I guess I'll check it out. I've been using Zope for 7-ish years and just never bothered. -- Ron ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Packing data.fs programmatically
Ron Bickers wrote: On Tue January 31 2006 07:47, Chris Withers wrote: I do it though the webinterface with a wget from the crontab: Oh, ouch ouch bad fragile pain failure suffering... URL whacking is evil and must be punished... How is this different than clicking on the Pack button in the ZMI? That's also evil, because yes, it is just URL whacking with a browser... What's the solution without ZEO and without having to stop Zope? You use ZEO. Get over it, it should be how a standard Zope instance is set up, IMNSHO... Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Packing data.fs programmatically
On Tue January 31 2006 07:47, Chris Withers wrote: > > I do it though the webinterface with a wget from the crontab: > Oh, ouch ouch bad fragile pain failure suffering... > > URL whacking is evil and must be punished... How is this different than clicking on the Pack button in the ZMI? What's the solution without ZEO and without having to stop Zope? -- Ron ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Packing data.fs programmatically
Jonathan Cleaver wrote at 2006-1-31 11:38 +: > ... >Now for the wierd bit. I successfully ran the code that went into this >module line-by-line in the Python interpreter. The data.fs was >beautifully packed. However, when I run this script from the command >line (through another script that acts as a hook) the line "app = >Zope.app()" fails with the error "No such file or directory". *ALWAYS* look at the traceback! It tells you where precisely the error happens... -- Dieter ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Packing data.fs programmatically
Reinoud van Leeuwen wrote: On Tue, Jan 31, 2006 at 11:38:34AM +, Jonathan Cleaver wrote: I am using the following module to pack my data.fs programmatically before a backup is made. This was largely taken out of the Zopelabs cookbook - thanks! I do it though the webinterface with a wget from the crontab: @daily cd /some_path/zeo_server/var && \ cp Data.fs Data.fs.pre_pack_backup && \ /usr/local/bin/wget \ 'http://myzopeserver/Control_Panel/Database/manage_pack?days:float=0'\ --http-user=special_user \ --http-passwd='some_password' \ --spider &&\ cp Data.fs Data.fs.post_pack_backup Oh, ouch ouch bad fragile pain failure suffering... URL whacking is evil and must be punished... Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Packing data.fs programmatically
On Tue, Jan 31, 2006 at 11:38:34AM +, Jonathan Cleaver wrote: > I am using the following module to pack my data.fs programmatically > before a backup is made. This was largely taken out of the Zopelabs > cookbook - thanks! I do it though the webinterface with a wget from the crontab: @daily cd /some_path/zeo_server/var && \ cp Data.fs Data.fs.pre_pack_backup && \ /usr/local/bin/wget \ 'http://myzopeserver/Control_Panel/Database/manage_pack?days:float=0'\ --http-user=special_user \ --http-passwd='some_password' \ --spider &&\ cp Data.fs Data.fs.post_pack_backup -- __ "Nothing is as subjective as reality" Reinoud van Leeuwen[EMAIL PROTECTED] http://www.xs4all.nl/~reinoud __ ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
Re: [Zope] Packing data.fs programmatically
Jonathan Cleaver wrote: I am using the following module to pack my data.fs programmatically before a backup is made. This was largely taken out of the Zopelabs cookbook - thanks! zeopack.py in the utilities\ZODBTools folder of your Zope distro is what you're after, no need for home-grown hackishness... -- Now for the wierd bit. I successfully ran the code that went into this module line-by-line in the Python interpreter. The data.fs was beautifully packed. However, when I run this script from the command line (through another script that acts as a hook) the line "app = Zope.app()" fails with the error "No such file or directory". My guess is that your environment is set up differently when it fails, PYTHON_PATH and the like... cheers, Chris -- Simplistix - Content Management, Zope & Python Consulting - http://www.simplistix.co.uk ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )
[Zope] Packing data.fs programmatically
I am using the following module to pack my data.fs programmatically before a backup is made. This was largely taken out of the Zopelabs cookbook - thanks! def packZODB(): try: import os, sys os.chdir("/path/to/Zope/python") sys.path+=['/path/to/Zope/python/was/required/to/load/Zope/module'] import Zope Zope.configure("/path/to/zope.conf") app = Zope.app() app.Control_Panel.Database.manage_pack(days=0) get_transaction().commit() app._p_jar.close() return 1 except Exception, inst: for arg in inst.args: print "Oh dear! %s" % arg -- Now for the wierd bit. I successfully ran the code that went into this module line-by-line in the Python interpreter. The data.fs was beautifully packed. However, when I run this script from the command line (through another script that acts as a hook) the line "app = Zope.app()" fails with the error "No such file or directory". Now I am confused, coz the code lines that you would expect to fail if either of the required paths were not correct ran quite happily. I am running Python 2.3.5 and Zope 2.7. Does anyone have any thoughts? Cheers Jonathan Cleaver ___ Zope maillist - Zope@zope.org http://mail.zope.org/mailman/listinfo/zope ** No cross posts or HTML encoding! ** (Related lists - http://mail.zope.org/mailman/listinfo/zope-announce http://mail.zope.org/mailman/listinfo/zope-dev )