When it comes to backing up my music, I have four problems. Apart from the backup, I mean.
In other words, I currently download to one machine – an Ubuntu equipped X301 – which has only enough space to contain a subset of the master library. As for the master library, it’s attached to a Mac Mini running OS X, which in turn needs to be regularly updated with the newly acquired tracks from the Ubuntu machine.
Got all that?
Besides migrating newly acquired content to the master library, one of the requirements of my backup process is to push the content to the cloud. As I noted in 2007, my music may just be my most valuable material possession, and it’s certainly the least replaceable, so having an offsite copy is critical to me. Just as it will be to a horde of consumers in the years ahead, but that’s a different matter entirely.
So here’s my solution, warts and all – and yes, I’ll get to those.
#!/bin/bash
#
# backup the home directory to copper
#
SUBJECT="Daily Backup Log"
EMAIL="sogrady@gmail.com"
BACKUPLOGFILE="/Users/sog/bin/backupMac.log"#remove the old log file in case it is still there
rm $BACKUPLOGFILEecho "Begin backup at: " > $BACKUPLOGFILE
date >> $BACKUPLOGFILErsync -rltvz /Users/sog/Dropbox/Music/ --exclude "Amazon MP3" /Volumes/"NO NAME"/"MUSICDIR"/ \
>> $BACKUPLOGFILE 2>&1rsync -rltvz /Users/sog/Dropbox/Music/"Amazon MP3"/ /Volumes/"NO NAME"/"MUSICDIR"/ \
>> $BACKUPLOGFILE 2>&1echo "End backup at: " >> $BACKUPLOGFILE
date >> $BACKUPLOGFILE# send the log in an email using /bin/mail
/usr/bin/mail -s "$SUBJECT" "$EMAIL" < $BACKUPLOGFILErm $BACKUPLOGFILE
The good news about the above: it will dutifully run rsync nightly to grab the target Dropbox directories and copy them over to the master directory. The bad news? It creates duplicate files. Lots of duplicates. My master music directory - both from this process and from previous backup efforts - has a massive duplication problem, probably on the order of several thousand duplicate files.
Which brings me to the question: anyone got an outstanding de-duplication procedure that will let me preview the files to be removed? Because I need some serious help.
Otherwise, what would you improve, and where? What's your backup routine look like?
Related posts: