Text 19 Apr Backin that thang up


How do you keep your digital valuables safe? One answer is to store duplicate copies on a different system. Ideally the backup copy will always be available if the original gets lost. This suggests putting the backup on a very different system to minimize the likelihood of a single problem destroying both the original and the backup. For example, having a few types of differences can provide benefits:
  • different machines to protect from theft and whole-machine crashes
  • different location to protect from fire
  • different hardware models to protect from device design problems
In terms of cost, backups should not interfere with one’s work or take up too many resources. Up until recently, I had a backup system that was running every day and storing copies of my data in a different machine/location/hardware system. Even though I tried to restrict it to make copies of the unique files I created (not the programs I installed), it took too long to run. The regular daily backups took 4 hours to find and copy roughly 200MB of files, and the once-weekly full backups took about 3 days to run. Yuck!

Why was it taking so long? It should have been smart enough to avoid copying files it already had before, but instead it sent a whole lot more than it needed to. So I chucked it and switched over to a new program for making backups and have been much happier with its speed and its function. Here’s a quick comparison of the positive and negative aspects of the two:

The old way: BackupPC
  • + no application to install on client systems
  • + works with windows and linux clients
  • + can save many historic snapshots
  • + web interface for browsing data, checking status
  • + stores only one copy of duplicate data files
  • - slow, due to unnecessary copying of unchanged data
  • - some performance impact when running
  • - no progress indicator, so no easy way to determine how long each backup will run
  • - setup can be complicated
The new way: Unison
  • + fast detection of new/changed/deleted files
  • + works with windows and linux clients
  • + allows multiple clients to mirror the same files, so laptop and desktop will be synchronized automatically
  • + can save previous versions of saved/deleted files
  • + gives an accurate estimate of time remaining
  • - requires application to be installed on client machines
  • - setup can be complicated
With the new setup I don’t need to leave my desktop on at night to make sure data will be backed up. And I will be able to synchronize my laptop and desktop files — even while travelling. Unison can check for new files in a few seconds, and transfer only the new stuff. For those considering it, I’d recommend these steps to set it up:
  1. install ocaml and its dependencies (used for compiling unison)
  2. download unison. I got version 431, aka 2.40.1
  3. compile unison. use the options “UISTYLE=text NATIVE=true” then copy it to /usr/local/bin
  4. set up profiles in ~/.unison
    I use a few different building blocks for profiles, and include them in super-profiles.
  5. set up an authorized key for ssh so unison doesn’t require a password to run
  6. set up logrotate for the unison log file
  7. set up cron job to run the unison process regularly

Page design by Prashanth Kamalakanthan. Hosted by Tumblr.