RE: [Zope] Packing with cron
Have you ever used this from cron? Just so I know before I try it. No I haven't tried it from cron yet but I see any reasons why you couldn't, except to make sure all the libs are in a common/accessable place. eg. Python/lib -Andy ___ Zope maillist - [EMAIL PROTECTED] 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 )
RE: [Zope] Packing with cron
I have a python script which uses XMLRPC to call an External Method that packs the database. Not ideal, but it does allow me to pack the database a) From Zope b) From the command line c) Whilst the server is running d) During very large imports which make ZCatalog Explode (I wish CatalogAware supported Sub Transactions) -Andy -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Jason Spisak Sent: 03 August 2000 16:37 To: [EMAIL PROTECTED] Subject: [Zope] Packing with cron Zopists, I am attemtping to use cron to pack my ZODB. I am using lalo's cron how-to and lynx. However when I visit http://myhost:8080/Control_Panel/Database/manage_pack nothing happens. Here is the command I am using in Zope 2.1.6: lynx -auth superuser:superuserpasswd -source http://myhost:8080/Control_Panel/Database/manage_pack Is there anything obviously skewed about this? Has anyone else tried it with success? Thanks in advance, Jason Spisak ___ Zope maillist - [EMAIL PROTECTED] 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 ) ___ Zope maillist - [EMAIL PROTECTED] 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 )
Re: [Zope] Packing with cron
Andy Dawkins writes: Thanks you for your prompt reply. I knew someone had to have a solution. Would you be willing to send me the script? Better yet, put it up as content on the Zope.org site. I have a feeling a list of solutions to this would help the community. All my best, I have a python script which uses XMLRPC to call an External Method that packs the database. Not ideal, but it does allow me to pack the database a) From Zope b) From the command line c) Whilst the server is running d) During very large imports which make ZCatalog Explode (I wish CatalogAware supported Sub Transactions) -Andy -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of Jason Spisak Sent: 03 August 2000 16:37 To: [EMAIL PROTECTED] Subject: [Zope] Packing with cron Zopists, I am attemtping to use cron to pack my ZODB. I am using lalo's cron how-to and lynx. However when I visit http://myhost:8080/Control_Panel/Database/manage_pack nothing happens. Here is the command I am using in Zope 2.1.6: lynx -auth superuser:superuserpasswd -source http://myhost:8080/Control_Panel/Database/manage_pack Is there anything obviously skewed about this? Has anyone else tried it with success? Thanks in advance, Jason Spisak ___ Zope maillist - [EMAIL PROTECTED] 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 ) Jason Spisak CIO HireTechs.com 6151 West Century Boulevard Suite 900 Los Angeles, CA 90045 P. 310.665.3444 F. 310.665.3544 Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats. ___ Zope maillist - [EMAIL PROTECTED] 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 )
RE: [Zope] Packing with cron
Jason I'm not sure if it is worthy of putting up on Zope. Although I'm sure people will correct me if I am wrong. But I have no problems in letting you have it packDb.py is the main python script. You will need to change the line that reads s=xmlrpclib.Server('http://myserver:8080/', transport=None, username='username', password='password') To reflect your correct server details. xmlrpclib.py xmlrpc Library for python. Place this in your python/libs directory, or the same directory as packDb.py packExtension.py This contains the code for the external Method. Place this in your zope/Extensions directory. Create it if it doesn't exist. You will need to add an external method to the root of your ZODB that points to packExtensions.py script If you have any problem then please let me know. -Andy #!/usr/bin/python # This module will pack zopes database # Assuming you have placed the pack external method in the root import sys, xmlrpclib class packDb: def __init__(self): s=xmlrpclib.Server('http://myserver:8080/', transport=None, username='username', password='password') # This is the external method. If you haven't placed it in the root then adjust as required. s.pack() if __name__ == '__main__': x = packDb() def pack(self, REQUEST=None): self.Control_Panel.Database.manage_pack() return 'Done' # # XML-RPC CLIENT LIBRARY # # With Amos Latteier's Basic Authentication code added # # $Id$ # # an XML-RPC client interface for Python. # # the marshalling and response parser code can also be used to # implement XML-RPC servers. # # Notes: # this version uses the sgmlop XML parser, if installed. this is # typically 10-15x faster than using Python's standard XML parser. # # you can get the sgmlop distribution from: # #http://www.pythonware.com/madscientist # # also note that this version is designed to work with Python 1.5.1 # or newer. it doesn't use any 1.5.2-specific features. # # History: # 1999-01-14 fl Created # 1999-01-15 fl Changed dateTime to use localtime # 1999-01-16 fl Added Binary/base64 element, default to RPC2 service # 1999-01-19 fl Fixed array data element (from Skip Montanaro) # 1999-01-21 fl Fixed dateTime constructor, etc. # 1999-02-02 fl Added fault handling, handle empty sequences, etc. # 1999-02-10 fl Fixed problem with empty responses (from Skip Montanaro) # 1999-06-20 fl Speed improvements, pluggable XML parsers and HTTP transports # # Copyright (c) 1999 by Secret Labs AB. # Copyright (c) 1999 by Fredrik Lundh. # # [EMAIL PROTECTED] # http://www.pythonware.com # # # The XML-RPC client interface is # # Copyright (c) 1999 by Secret Labs AB # Copyright (c) 1999 by Fredrik Lundh # # By obtaining, using, and/or copying this software and/or its # associated documentation, you agree that you have read, understood, # and will comply with the following terms and conditions: # # Permission to use, copy, modify, and distribute this software and # its associated documentation for any purpose and without fee is # hereby granted, provided that the above copyright notice appears in # all copies, and that both that copyright notice and this permission # notice appear in supporting documentation, and that the name of # Secret Labs AB or the author not be used in advertising or publicity # pertaining to distribution of the software without specific, written # prior permission. # # SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD # TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- # ABILITY AND FITNESS. IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR # BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY # DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, # WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS # ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE # OF THIS SOFTWARE. # import string, time import urllib, xmllib, base64 from types import * from cgi import escape try: import sgmlop except ImportError: sgmlop = None # accelerator not available __version__ = "0.9.8" # # Exceptions class Error: # base class for client errors pass class ProtocolError(Error): # indicates an HTTP protocol error def __init__(self, url, errcode, errmsg, headers): self.url = url self.errcode = errcode self.errmsg = errmsg self.headers = headers def __repr__(self): return ( "ProtocolError for %s: %s %s" % (self.url, self.errcode, self.errmsg) ) class ResponseError(Error): # indicates a broken response package pass class Fault(Error): # indicates a XML-RPC fault
Re: [Zope] Packing with cron
Andy Dawkins writes: Thank you Andy. That was generous. Have you ever used this from cron? Just so I know before I try it. All my best, Jason I'm not sure if it is worthy of putting up on Zope. Although I'm sure people will correct me if I am wrong. But I have no problems in letting you have it packDb.py is the main python script. You will need to change the line that reads s=xmlrpclib.Server('http://myserver:8080/', transport=None, username='username', password='password') To reflect your correct server details. xmlrpclib.py xmlrpc Library for python. Place this in your python/libs directory, or the same directory as packDb.py packExtension.py This contains the code for the external Method. Place this in your zope/Extensions directory. Create it if it doesn't exist. You will need to add an external method to the root of your ZODB that points to packExtensions.py script If you have any problem then please let me know. -Andy Jason Spisak CIO HireTechs.com 6151 West Century Boulevard Suite 900 Los Angeles, CA 90045 P. 310.665.3444 F. 310.665.3544 Under US Code Title 47, Sec.227(b)(1)(C), Sec.227(a)(2)(B) This email address may not be added to any commercial mail list with out my permission. Violation of my privacy with advertising or SPAM will result in a suit for a MINIMUM of $500 damages/incident, $1500 for repeats. ___ Zope maillist - [EMAIL PROTECTED] 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 )