Re: How to locate unused objects?

Niels Dettenbach <nd-ImmFMecdQhFWk0Htik3J/[email protected]> Thu, 06 Mar 2014 11:10:20 +0100
Newsgroups gmane.comp.web.zope.general
Organization Syndicat IT&Internet
Message-ID <1892395.pInrAM68Ph@gongo>
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
 ---

_______________________________________________
Zope maillist  -  [email protected]
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 )
signature.asc (application/pgp-signature, 836 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.22 (GNU/Linux)

iQIcBAABCAAGBQJTGEmMAAoJEM78prARigUnJRUP/1RUa55rnJB0OYhfbzOEb7oG
zR4mCLpRhqNyi3cCPMRYXpBuhNsUIPOZwZaABcOJtgs5CGyp9sEluu+jNnQef5tw
TRxnjo/8wImOV2umb6usrZb5roL2s6/YEaEBMdurg3HZ1qpyhxa6tU0qcUtPNSQt
QiM+GrLzXiK1HQ6E5SQFpft4m31M73xXdBtTnqpxGlcGMl5Mr9s4wwKzHs9j72HJ
DgMKFHRO/kxCMSTn32p8a/cbvdd5ao0gOV53EA9baGUHwsoVC4CyboJG7+j8DjKa
319amGcO0mTAVp+W2qJPzyqRza99awDkh5eGenWyzX8bb5MyhcmCjBRg3yUfddHC
W1K8NKt3DXBmT1AF8Vu5FT/Wv7z6GmIHo6AXILrgDW7BJHjf/dwe/WWEusHFItkd
M+yfo2Z0R85QrHmgNkAPzGaC9jtRi3OM6IZ1Wy+aKMwKhPHQrkH41wZU9NKrwLT2
GmwIl6pqiIw3n/bo3z379ddm1ODp5a4dL3WXYKGFwYD4fLtqBekwi8bpx6wYbU0I
BnzDTEVwJEK43Z14anKeoLOY4xIc/jHWwRA/B0VOGCkZJ31F68dKklAZbyGnphh4
gAxznduZqJaRyTj/u5WVRWPsR1MoWaEAYTWqnERCF9rsYz/SiEBpRt1DiRVWZ7eh
ZHJnjuz0fcwaTXBlsk9Y
=QGH2
-----END PGP SIGNATURE-----