Picture Backup with Rsync

snapshot6.pngUtilizing the Rsync setup I created earlier to backup the Documents folders of our laptops, I came up with a method to backup my newly organized picture collection.

The situation is as follows: My Ubuntu machine keeps the working copy of my photo collection and I would like to back up all the pictures as often as possible to the G3 PowerMac, which has an extra hard drive and is on all the time (its the webserver, printserver, MySQL server, etc).

To accomplish this, I set up passwordless authentication between these two machines, like in the other Rsync setup and then used this shell script on the Ubuntu box to get things moving:

#!/bin/sh
rsync -e “ssh” -rca –delete-after ~/PicasaDocuments/ username@192.168.1.x:/Volumes/back/pictureBackup -vv

/bin/date > ~/backup_script/log.txt

There’s not much difference between this and the previous shell script. This will build a list of the folders / files in the PicassaDocuments folder on my Ubuntu machine, and then match that list on the extra hard drive in the PowerMac (/Volumes/ is the location of all the mounted drives). the “–delete-after” means that if an item was deleted in the original folder, it will be deleted in the backed-up folder as well (not delete the originals after backing-up, like I feared it meant).

After this completes, it should write the date to log.txt in my home directory on the Ubuntu box.

Since both of these machines will be on most of the time, I decided to add this script to Cron to get it working every night. I used KCron (shown above), the KDE GUI to Crontab. Gnome has a Crontab editor too. I set it up to run this script every night at 11:15. After the initial backup of all the pictures, the process seems to run in 5 – 10 minutes. Its a bit taxing to the Ubuntu system, but it can handle it when nothing else is going on.

So with this system, I keep two copies of all my pictures on two different hard-drives. Not a bad deal.

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: