Kumar Appaiah: A backup workflow with bup
It's important to back things up. You should also make your life easier by using some good software. I use obnam for some backups, but I wanted to try out bup for a new backup workflow I needed. I will describe the workflow here.The situation: I have a laptop with things to be backed up. I also have a Raspberry Pi which I use as a network attached storage (it has a 1 TB external drive attached to it) and runs Raspbian Wheezy on it. Naturally, you can do this on any NAS running some GNU/Linux variant. In addition, I also have an external portable USB hard disk where another backup copy will be stored. How do I automate this?Here is how I went about this process. First, for the Raspberry Pi:
- First, identify the directory or directories to be backed up. To keep this simple, the directory I am backing up is /home/kumar/Work.
- On the Raspberry Pi, install bup. If you want to build it from the git clone, you would need python-dev, and pandoc for the documentation.
sudo aptitude install pandoc python-dev git clone git://github.com/apenwarr/bup.git cd bup;make;sudo make install
- Initialize the backup directory on the Raspberry Pi:
BUP_DIR=/home/kumar/BACKUPS bup init
BACKUPS is the place where bup is asked to store the backups (much like it's analogue of .git). You can store all your backups within this directory, and you can still classify backup sets within this directory with different names (much like git branches). - On the local machine, initialize the backup directory.
bup index -uv /home/kumar/Work
- Back it up. This will take time the first time, if the Work directory has several contents within it.
bup save -r kumar@<raspberry_pi_ip_address>:BACKUPS -n workbackup /home/kumar/Work
workbackup is the name of the backup set. This can be paperbackup or databackup or notesbackup so that several classes can be backed up within the BACKUPS directory. - Now, you have backed things up. Make changes in the Work directory. For instance, add/edit/remove/move some files.
- Rerun the index and save commands from steps 4 and 5 above. Enjoy the speedup and ability to rewind to the previous state.
- Test restoration of ONE directory of backup (just to save time) on Pi itself directly on the Pi:
bup -d /home/kumar/BACKUPS/ restore -C /tmp/ /workbackup/latest/home/kumar/Work/offset-coupling-params
Then scp it back if you need it. - Alternative: Use fuse. On the Pi:
sudo aptitude install python-fuse sudo adduser kumar fuse mkdir Mount bup -d /home/kumar/BACKUPS fuse Mount Then cd into Mount and cp/scp the correct files wherever. fusermount -u Mount
- Once happy, write the bup index/bup save commands into a script and run it periodically to back up (check this at the end of the post). Have fun.
- To automount the disk, in /etc/auto.master, add
/auto /etc/auto.misc --timeout=60
- In /etc/auto.misc add:
backupdrive -fstype=btrfs :UUID="7927a7ab-8c3f-4198-bd73-d3cc519a9ac3"
fstype may need changing for your file system, and UUID can be found using blkid on the exact partition of the hard disk you wish to back up to. - Initialize the backup directory:
sudo mkdir /auto/backupdrive/BACKUPS sudo chown kumar.kumar /auto/backupdrive/BACKUPS bup -d /auto/backupdrive/BACKUPS/ init
- Index and back up:
bup -d /auto/backupdrive/BACKUPS/ index -uv /home/kumar/Work bup -d /auto/backupdrive/BACKUPS/ save -n workbackup /home/kumar/Work
- Make changes in the Work directory. Add/edit/remove/move files.
- Rerun index and save commands from step 5. Enjoy the speed.
- Test restoration of ONE directory of backup from removable disk:
bup -d /auto/backupdrive/BACKUPS/ restore -C /tmp/ /workbackup/latest/home/kumar/Work/offset-coupling-params
- Once happy, write the bup index/bup save commands into a script and run it periodically to back up. Have fun.
#!/bin/sh
bup index -u /home/kumar/Work
bup save -r kumar@<raspberry_pi_ip_address>:BACKUPS -n workbackup /home/kumar/Work
if ls /auto/backupdrive/ 2> /dev/null;then
echo Backing up to the removable disk...
bup -d /auto/backupdrive/BACKUPS/ index -u /home/kumar/Work
bup -d /auto/backupdrive/BACKUPS/ save -n workbackup /home/kumar/Work
echo Backed up to the removable disk! Yay!
else
echo WARNING: Not backing up to the removable disk
fi
What this script does it, it backs up to the NAS, and then checks if the external disk is connected. If the disk is mounted, then it backs up to that disk as well. It might be a good idea to cron or anacron this script, or have someone remind you to run this periodically. The only limitation I have is that you can't use bup restore to restore from a remote repository yet, but that isn't a huge issue for me now. In addition, metadata is not stored by the bup save/restore commands. You would have to use split and join with tar to get that. However, bup is fast moving, so I'd expect these features soon. Till then, this workflow works all right for data only backups.Although this is just a mental dump of the procedure I made for myself, suggestions for improvement are welcome. Thanks.
A few days ago I had the great pleasure to interview Allan Day, GNOME designer and enthusiastic contributor.


I wondered how to properly maintain an
I was working on writing tests for gnome-settings-daemon a week or so ago, and finally got blocked on being unable to set up upower/ConsoleKit/etc. the way I need them. Also, doing so needs root privileges, I don t want my test suite to actually suspend my machine, and using the real service is generally not suitable for test suites that are supposed to run during make check , in jhbuild, and the like these do not have the polkit privileges to do all that, and may not even have a system D-Bus running in the first place.
So I wrote a little
Hello, World!
At
How to get it
As St phane mentioned in the python3-lxc blog entry, the API hasn t yet been finalized and llxc itself is in an early state and many changes are planned, so it s definitely not meant for production use yet, but since we believe in release early, release often in the free software community, here goes
Currently, llxc.py itself is *very* Ubuntu specific and its only been tested on Ubuntu 12.04, but that will be fixed once more of its kinks have been ironed out. Some people are also working on getting python3-lxc on other distributions, which will help a lot.
The llxc.py script itself is hosted on Github:
Thoughts about DRI.Next
On the way to the X Developer s Conference in Nuremberg, Eric and I
chatted about how the DRI2 extension wasn t really doing what we
wanted. We came up with some fairly rough ideas and even held an
Just about three years ago, I created the
I'm just back from having spent a week in Helsinki. Despite some minor irritations (the light-switches were always too damn low) it was a lovely trip.
There is a lot to be said for a place, and a culture, where shrugging and grunting counts as communication.
Now I'm back, catching up on things, and mostly plotting and planning how to handle my backups going forward.
Filesystem backups I generally take using backup2l, creating
local incremental backup archives then shipping them offsite using
rsync. For my personal stuff I have a bunch of space on a
number of hosts and I just use rsync to literally copy my
~/Images, ~/Videos, etc..
In the near future I'm going to have access to a backup server which will run rsync, and pretty much nothing else. I want to decide how to archive my content to that - securely.
The biggest issue is that my images (.CR2 + .JPG) will want to be encrypted remotely, but not locally. So I guess if I re-encrypt transient copies and rsync them I'll end up having to send "full" changes each time I rsync. Clearly that will waste bandwidth.
So my alternatives are to use incrementals, as I do elsewhere, then GPG-encrypt the tar files that are produced - simple to do with backup2l - and us rsync. That seems like the best plan, but requires that I have more space available locally since :
Some days ago I moved to
Last week, I was
I just finished reading
Yesterday,
So, let's start with an introduction:
To shortly describe the main 