[ZODB-Dev] Copying filestorage file while program is running

Toby Dickenson [email protected]
Thu, 17 Oct 2002 13:22:26 +0100

On Thursday 17 Oct 2002 11:01 am, Ury Marshak wrote:
> Toby Dickenson wrote:
> > > What about the tmp- and index-files? Might we need them?
> >
> > tmp- you *never* need.
> >
> > index- I suggest not backing up. It is only used to make startup fast=
> Not
> > having it will make startup a little slower until a new index- is
> > written.
> If
> > your database has changed since the index was written then it will no=
t be
> > used anyway.
> I was thinkng about using the following approach - performing a pack,
> and backing up a .old file, while the work may continue with the new
> .fs file. Does this sound reasonable, or am I missing something
> crucial?

I guess most people would want to perform a backup more frequently than t=
would want to perform a pack. If it works for you, I dont see a problem.

> If there is a way
> to perform a hot backup remotely, from the client machine,
> that would be even better.

For FileStorage I have used a process which is essentially

 ssh zeoserver cp data.fs data.fs.outgoing
 rsync zeoserver:data.fs.outgoing data.fs.incoming
 cp data.fs.incoming data.fs.new
 mv data.fs.new data.fs.backup
 ssh zeoserver rm data.fs.outgoing

That process works, is provably safe, and is efficient on bandwidth. The=20
downside is that it uses *alot* of IO and disk space.

For DirectoryStorage, there is a script to efficiently produce an increme=
backup tar file.

> As a side question: what would be the correct way to shut ZEO down?
> ATM I'm just killing the server process, is there a less rude way to
> perform a clean shutdown?

I think this has changed in ZEO 2 cvs. Guido is looking to improve it fur=
for 2.0 or ZEO 2.1