Backing up my home directory using rdiff-backup

A while back I wrote about my backups scripts I made with rsync. I have since refined my scripts, and am now using rdiff-backup instead, which creates versioned backups. I delete backups older than 6 weeks, so I can roll back to any backup I've made in the last 6 weeks. I would prefer if I could specify the frequency of the versions... for example, make a backup a day for the past 45 days, and hold onto a version per month for every month before 45 days, forever. However, rdiff-backup does not support this. There are several hand-rolled solutions out there using bash scripts and rsync, however I prefer the plug-and-play ease of use offered by rdiff-backup.

My new dailybackup script is below.

BASH:
  1. #!/bin/sh
  2.  
  3. ARCHIVEROOT=/Volumes/backup/backup ;
  4.  
  5. ###########################################
  6. ## Home Directory #########################
  7. ###########################################
  8. SOURCEDIR=/Users/john/ ;
  9. ARCHIVENAME=PowerBookHomeDirectory-rdiff-backup ;
  10.  
  11. rdiff-backup \
  12.     -v4 \
  13.     --print-statistics \
  14.     --exclude-sockets \
  15.     --exclude $SOURCEDIR"tmp/" \
  16.     --exclude $SOURCEDIR"Library/Caches/" \
  17.     --exclude $SOURCEDIR"Library/Safari/Icons" \
  18.     --exclude $SOURCEDIR"Desktop/downloads/" \
  19.     --exclude $SOURCEDIR".Trash/" \
  20.     --exclude $SOURCEDIR"Movies/Democracy/" \
  21.     $SOURCEDIR $ARCHIVEROOT/$ARCHIVENAME ;
  22.  
  23. rdiff-backup --print-statistics --force --remove-older-than 6W $ARCHIVEROOT/$ARCHIVENAME

6 Responses to “Backing up my home directory using rdiff-backup”


  1. 1 Jeff

    Very nice! I think I'll give this a try. No matter how I try, I'm still terrible at back-ups.

  2. 2 josh

    me too. Very nice.

    Is the backup volume on the network, or local?

  3. 3 John

    /Volumes on OS X is the mount point for external drives and network drives. In my case it's an external firewire drive.

  4. 4 Max Starkenburg

    Any opinion on services like Mozy?

    Hmm ... do links work? Test: Mozy

  5. 5 John

    I've never used one of those services. I could used rdiff-backup to push the backups to my dreamhost account, but that would take hours and hours for the first backup and a lot of time for each subsequent backup. I suppose I could do it in the middle of the night...

  6. 6 Max Starkenburg

    Yeah, it's taking a while (~1.5 gb/day) for me on Mozy, but I'm not backing up everything, and I just leave it running all the time (there's a slider to adjust how much network it's using, so that things aren't super slow when I actually want to use the computer, but I put it back to full blast before going to bed or work).

Leave a Reply




Close
Powered by ShareThis