[Zope] Re: Packing Data.fs
Tres Seaver
tseaver at palladion.com
Tue Aug 29 20:07:01 EDT 2006
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Mark Gibson wrote:
> I know zope makes a copy of Data.fs before packing. Is it possible to
> specify a location other than <zope>/var to place that copy?
Actually, it makes a *new* file when packing, and then unlinks the old
file and re-links the copy under its name after finishing the pack
successfully. If you are looking to "spread the love" across multiple
partitions, you can symlink the original file into a directory on
another drive / partition, and then do the pack there. One the pack
completes, you can move or copy the packed version back to the original
directory.
To do the pack in the temporary directory, something like the following
Python script should work::
#!/path/to/your/python
import time
from ZODB.FileStorage import FileStorage
to_pack = FileStorage('/mnt/space/packing/Data.fs')
when = time.time() - (7 * 86400) # one week ago
to_pack.pack(when)
Tres.
- --
===================================================================
Tres Seaver +1 202-558-7113 tseaver at palladion.com
Palladion Software "Excellence by Design" http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFE9Nal+gerLs4ltQ4RAnIDAJ4uMnZFWxT2QUGIxUX8pYEU3ZAHCgCff2p5
ptA83pek4hISALzRwiX7wIU=
=gz4O
-----END PGP SIGNATURE-----
More information about the Zope
mailing list