Mailing List Archive

How to locate unused objects?
Dear zopistas,

does somebody have script to locate (and delete) unaccessed files (not
viewed from some date) in the ZoDB tree with webserver log?

Regards,

Jaroslav Lukesh

_______________________________________________
Zope maillist - Zope@zope.org
https://mail.zope.org/mailman/listinfo/zope
** No cross posts or HTML encoding! **
(Related lists -
https://mail.zope.org/mailman/listinfo/zope-announce
https://mail.zope.org/mailman/listinfo/zope-dev )
Re: How to locate unused objects? [ In reply to ]
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
---