[Zope] Auto-copy objects from one folder to another?

Oliver Bleutgen Oliver Bleutgen <myzope@gmx.net>
Tue, 29 Jan 2002 00:21:20 +0100


> I want to be able to make periodic backups of objects from one folder to
> another automatically;  I would like to back up modified objects in one
> folder periodically to another nearly identical folder mounted on an
> external ODB via ExternalMount and ZEO.  I've never considered what it
> would
> take to copy an object from one place to another, so I had a few
> questions:

> - Is the best solution just to take the _getObject() from folder1 and do a
> _setObject() in Folder 2?
> - How reliable is bobobase_modification_time for using to determine object
> modification time in Folder1?
> - Related to the above, might it work to wrap backed-up objects with an
> extra property containing the original mod time on the object when it
> lived
> in Folder1 as a means of comparison?  The other thought I had was to
> figure
> out a way to get an MD5 or SHA hash for the object, but I figure that
> doing
> this on a folder with thousands of objects might be a total waste of
> CPU...
> - Any other thoughts?

Sean,

this might not be what you need, but perhaps it's worthwhile anyway.
Instead of periodic backups, can't you just use a special object manager
for that folder which you want to backup?
For instance, override _setObject to instead of just doing it's stuff on
self, doing it also on your backup storage. Take %Y%Y%Y%Y%M%M%D%D as the
destination folder id (autocreated) and you have your weekly archive.
If these destination folder are transparent to acquisition, you could also
have the same behavior as the original folder, while having all weekly 
revisions of your objects.

Ok, I admit it, I didn't answer any question.


cheers,
oliver