[Zope] How to locate unused objects?

Niels Dettenbach nd at syndicat.com
Thu Mar 6 11:10:20 CET 2014


Hi Jaroslav,


Am Donnerstag, 6. März 2014, 06:44:22 schrieb Jaroslav Lukesh:
> does somebody have script to locate (and delete) unaccessed files (not 
> viewed from some date) in the ZoDB tree with webserver log?
hmmm,

this is a confusing question. What do you mean with" files in the ZODB"? File 
objects? The ZODB only consists of "objects" - not files even when they are 
shown like "files" over HTTP, DAV or FTP.

I think you are targeting a confusing way of solution. If you really want to 
delete some objets from your ZODB if they are not "accessed" over a time i 
would suggest the following solution:

 - if your object type does not provide an "last access" timestamp property or 
similiar in a way you need it ("access" in such a context could do mean a lot 
of different things in zope) you may add such an property to that objects and 
write a method which is proxying access to that objects (i.e. deliver it out 
over web) and updates that property to current time(stamp)/datetime.

 - write a simple method / Python Script / External Method which recursively 
looks for objects (i.e. of the regarding type) with your timestamp property 
and compare with current date. If the property is "to old" let delete or do 
whatever with em.

I'm nearly to shure that no one has a script working as you described here for 
such a job, because access to the logfiles plus log data conversion would be 
much more difficult and could not be used in such a more general way.

hth
good luck.
cheerioh,


Niels.
-- 
 ---
 Niels Dettenbach
 Syndicat IT & Internet
 http://www.syndicat.com
 PGP: https://syndicat.com/pub_key.asc
 ---
 



-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://mail.zope.org/pipermail/zope/attachments/20140306/29d74266/attachment.sig>


More information about the Zope mailing list