#simple script to pack your database from the command line. put in crontab
#no error checking done.
import os
myzope="/usr/local/Zope"
os.chdir(myzope+"/lib/python")
myday = 0
try:
import Zope
app = Zope.app()
#a lot more interesting stuff can be done here. e.g
#for i in app.objectItems():
# print i.id()
#
app.Control_Panel.Database.manage_pack(days=myday)
get_transaction().commit()
app._p_jar.close()
except:
#do interesting stuff here, mail , sms, etc
print "cant pack"
Explanation:
these tidbits were lifted off the various mailing lists.
copy the script, and put in the crontab to exec every nth hour/day/week
As shown in the script, we can do much much more. e.g uploading files, deleteing objects, etc
Comments:
title change? by runyaga - 2001-09-02
how about Packing ZEO Clients? I like it. I wish the entire ZOPE API were documented somewhere. Has anyone tried to pydoc ZOPE, using python 2.1?
Re: title change? by kedai - 2001-09-02
i thought when packing database from any ZEO Clients, it'll pack the
ZSS/main database ..?
or am i wrong?