hbackup

This project is now terminated. There will not be any further releases.

hbackup is a tool for backing up UNIX-like systems to external hard disks (and of course restoring). It remains something of a work in progress though I've been using it for my own backups for over a year now. Linux and Darwin (Mac OS X) are supported. There is a Python version and a (more featureful) C++ version. You can use either a locally connected disk or a remote one via SFTP.

Downloads

The latest released source code is hbackup-0.2.tar.gz. You will need PCRE. To install:

$ ./configure
$ make
$ make install      # as root

How It Works

Backups are performed by writing an index of all the directories and files on the source filesystem to a single file. This records their name, permissions, etc. For very short files it may also include their contents but for long files it just includes a hash of the contents.

There is a separate directory structure which contains a mapping between hashes and file contents.

Some useful consequences of this design are:

  1. Duplicate files are stored only once on the backup medium. When the second copy is encountered, it is already there in the hash directory and so need not be written again.

    Moreover if you back up several hosts to the same medium then files common to both hosts, for instance many of the files under /usr, only appear once on the backup device.

  2. All backups to the same medium are incremental, for the same reason. When you make a second backup, only the index and new files need be written to the backup medium.

  3. The semantic demands on the backup filesystem are relatively light, and FAT32 will suffice. This makes it easier to share backup devices between different platforms.

It should be said that a less useful consequence is that when you delete old indexes, the removal of files no longer referenced by any index is a relatively slow and expensive process.

See the README for more information.

Development

You can retrieve a nightly snapshot using Bazaar as follows:

$ bzr clone http://www.greenend.org.uk/rjk/bzr/hbackup.dev hbackup
$ cd hbackup
$ ./prepare
$ ./configure
$ make
$ make install      # as root

Future Plans

There are no future plans. This project is now terminated.

Licence

hbackup is © 2006, 2007-2009 Richard Kettlewell.

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

RJK | Contents