Search code examples
backupbazaar

bzr - create tgz file containing full repository


I'm trying to backup my shared bzr repository. I have looked at bzr export hotcopy.tgz but it seems only to take a snapshot of the latest revision.

Is there a command for doing backups, or do I have to

  1. full checkout into a tmp dir
  2. compress the tmp dir
  3. remove the tmp dir

Or is there a better way to backup a bzr repository?


Solution

  • You could try something like this:

    mkdir /tmp/emptyrepos && bzr init /tmp/emptyrepos && bzr send -r 1..last:1 -o - /tmp/emptyrepos | gzip > mybackup.bzr.gz
    

    That will create a bazaar native format merge-directive which you could apply to an empty repository to re-create all state.

    Alternatively, it's likely safe to just tar up the current checkout. The on-disk format should be designed to safely deal with partial updates you may grab with tar.