What is a safe way of backing up a shared bzr repository

Aaron Bentley aaron.bentley at utoronto.ca
Fri Nov 16 14:55:48 GMT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Alexander Belchenko wrote:
> Basically you could just tar shared repo.
> But potentially you can end up with incomplete history in some branch
> if someone will try to commit when you try to backup. You may end up
> with some junk info in the backup archive, locked repo/branch etc.
> 
> IMO, safest way is to duplicate your shared repo with branches before
> archiving, and delete after you created tarball.

This just changes the time when concurrent updates can produce an
inconsistent repository.  Instead of worrying about someone committing
while you're tarring, you worry about someone committing while you're
duplicating.

If you're actually worried about concurrent updates (I'm not-- we do our
backups when no one's working) then you need to lock your repository.

Here is a simple script allows you to run a command with your repository
write-locked.

You use it like by specifying a path to your repository, followed by any
arbitrary command.  e.g.

$ ./backup-repository /mnt/bzr/bzrrepo cp -r /mnt/bzr/bzrrepo/ mybackup

Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD4DBQFHPa9z0F+nu1YWqI0RAptoAJ4vb2+hOm4gkk9toIaVA2gP3GillgCSA88D
712GSmEVIqSV5TzTS9ImQA==
=6MdC
-----END PGP SIGNATURE-----
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: backup-repository
Url: https://lists.ubuntu.com/archives/bazaar/attachments/20071116/50a5262e/attachment.diff 


More information about the bazaar mailing list