Backing up bazaar repos

In one of my previous post I mentioned that my blog was brokenito. Actually my blog is just a bunch of markdown files that I compile in a blog with ikiwiki, and I store it in a Bazaar repo.

A month ago I bought a new hardisk that I installed in my notebook, replacing the one that used to have the sources of my blog. I reinstalled Debian Sid from scratch1 and just grabbed everything from the backups (yes, I have weekly backups. How many can say that? :)

The problem was this: the backups included the Bazaar working copies/branches, except for the (normally empty) directory .bzr/repository/upload/. This directory is populated with a temporary file each time you do a commit, but bzr doesn't try to create it if it doesn't exist. I think they assume it's a given because it's created when you do a bzr init.

So here are two bugs: first my backup system (just a bash script that runs rsync) should store empty directories (fixed) and I think bzr should create the dir if it's not there. I will try to make a patch and submmit a wish in their bugtracker.

This oneliner should fix all my restored repos:

find . -name .bzr | while read repo; do mkdir -vp $repo/repository/upload/; done

  1. Somehow I feel the new instalation faster than the previous one, specially when installing new software or updates. I think this might be related to the high fragmentation that the old system might have. I should explore this.