Laptop Backup via Rsync + iPod

My previous post talked about using rsync to backup securely to another computer over the Internet. What if you want a local spare backup or do not have Internet?

Here is what I did on my mac powerbook.

Set your iPod so you can use it as a removable drive. iPod has to be set to “Enable Disc Use”.

Create an Encrypted Sparse Disc Image on the iPod. You can just follow the directions over on Macosxhints.com

hdiutil create -size 5g -encryption -type SPARSE -fs HFS+ Backup

That creates an encrypted sparse image file named Backup that maxes out at 5GB. We open the image once, and rename the Drive name label to EncryptBackup. That will be what shows if we look at the mounted volumes.

Now all you have to do is use a nice rsync command to backup your documents into the mounted encrypted Spare Image.

rsync -avg –exclude “Documents/browseback/” ~/Documents /Volumes/EncryptBackup

That will sync our Documents folder over into the Encrypted Backup image file on the iPod just as if it were its own drive. Note the –exclude option. I have a program called BrowseBack for the Mac. It caches copies of everything I browse there so I can find previous content again via web, send to pdf, email etc. But I don’t want to backup all that cached data.

Update:

Modified the script I have on my iPod to mount, backup then dismount the image.

hdiutil attach /Volumes/iPod/Backup/Backup.sparseimage
rsync -avg –exclude “Documents/browseback/” ~/Documents /Volumes/EncryptBackup
hdiutil detach /Volumes/EncryptBackup

Then an Automator saved as an application onto the iPod and its an easy double click. If you save your image’s password in your keychain you won’t have to enter that either.

Share
  • furicle

    Consider using the –delete-after option. Needs more space during the backup, but prevents problems from interrupted backups.

    Note also the ‘g’ option isn’t required separately if you use ‘a’

    Lastly the ‘–stats’ option is reassuring to see, you could modify that automator script to pass it back to you on completion if you liked….

    Just some thoughts.

  • furicle

    Consider using the –delete-after option. Needs more space during the backup, but prevents problems from interrupted backups.

    Note also the ‘g’ option isn’t required separately if you use ‘a’

    Lastly the ‘–stats’ option is reassuring to see, you could modify that automator script to pass it back to you on completion if you liked….

    Just some thoughts.

  • From what I read on the man page. I don’t want delete after. I want my data to stay where it is and just have a backup copy in the encrypted image. Not moving it. Just copying. Or am I reading something wrong? Using stats or progress would be cool. Thanks for the suggestion.

  • From what I read on the man page. I don’t want delete after. I want my data to stay where it is and just have a backup copy in the encrypted image. Not moving it. Just copying. Or am I reading something wrong? Using stats or progress would be cool. Thanks for the suggestion.

  • furicle

    Delete after means if you are updating a file, don’t throw out the old version until after the new version is completely created and moved into place.
    Quoting the man page “–delete-after receiver deletes after transfer, not before”
    Receiver deletes, not sender – It doesn’t affect the source data at all.
    Normally not a big deal, but if you are using it on large files (like iso images) then an interrupted sync means it’s got to copy the whole file over the next time, and you’ve got no backup until then.

  • furicle

    Delete after means if you are updating a file, don’t throw out the old version until after the new version is completely created and moved into place.
    Quoting the man page “–delete-after receiver deletes after transfer, not before”
    Receiver deletes, not sender – It doesn’t affect the source data at all.
    Normally not a big deal, but if you are using it on large files (like iso images) then an interrupted sync means it’s got to copy the whole file over the next time, and you’ve got no backup until then.