Backups

August 25, 2008

Since the last few posts have been more on a ‘managing music libraries’ theme than a ‘getting good free music’ one, I thought I’d keep that going for one more day.

Backups.

You do something, right?  Because even if you can redownload all your music, it would be a big hassle.  Think how long it would take.  Think how much clicking.  And the can is a big ask.  Do you remember every single indie label whose store you ever bought a single from?  Do you want to re-rip all those CDs.  And with the iTunes store, you’re plain out of luck.  They make it very clear backups are your responsibility – remember that nag screen when you purchase a whole album?  Amie Street and emusic let you redownload (as iTunes should) but even they can’t help much if the album has since been removed from the store.  And this happens, take a look at the emusic message boards.

So make sure you back up.

You could use a commercial backup utility, or your OS’s native one, but in a sense there’s not much point.  Zipping or otherwise compressing a mp3 file doesn’t make any difference to the the size – its already compressed.  It might even make the mp3 file bigger – the zip algorithm has its own overhead to manage. (Yes, linux people could tarball, but that’s an aside, we’re firmly in windows-world here).  Once you bundle everything up into a given format or another, you need access to that format to undo it again.  And again, with mp3s, there’s no point – compressed, they don’t get smaller.  There is a utility in iTunes to manage incremental backups, but it only works with burns to CD and DVD, not copying to hard disk, and 80 gig of music is a lot of DVDs.   Besides, I’d rather be able to watch and check the backup is going right – I’m just paranoid enough not to trust iTunes that far – and a lot of my music isn’t in iTunes anyway – classical music, for example, doesn’t lend itself as well to track-by-track management, and at any point there’s a lot of free music I haven’t yet listened to thoroughly and decided I’m keeping.

Just for the record, as I said, CDs or DVDs take a lot of disks. External hard drives are better for sets of files as big as a decent-sized music library, and managing incremental backups is easier onto hard drives.  Two separate drives that is – two complete backups plus wherever your master copies are.  Sounds paranoid, but a 120GB or 160GB drive costs the same as three or four new CDs, and the time cost is small if you do what I outline here.  Two complete and separate sets of backups means you can keep one off-site, and you’re covered against even very unlikely simultaneous failures.  Your music’s important to you, right?  There’s a lot of your time invested in your library.  That crap you work on all day at the office is backed up at least this well, and I kinda think my music is at least that important.

So, two backup drives and a batch file script.

I use robocopy to do the actual copying.  Its an old Windows add-on, and a very good one.  Get it in the Windows Resource Kits, or as a small download, as part of this Technet example download.  The key thing about robocopy is that its reliable.  Just to be clear, xcopy isn’t.  Clear on that?  Xcopy is not reliable under XP, especially not over UNC paths.  For various unexplained (by Microsoft) reasons, its doesn’t always copy all the files in 80 GB of music.  Use it if you will, but check the final files against the master set and after a couple of runs you’re pretty much guaranteed to find some double-ups or files missing.  Then have hours of fun with your favourite windows diff tool.  Robocopy is reliable.  For something like backups, its worth finding and using, to be safe.  Robocopy manages directory trees – you give it a master set of files, and an existing set of backup files you want to sync, and robocopy adds and deletes the backup set until it matches the master set.  This saves a lot of time doing massive music backups – only the changed files are actually copied.

A quick tip if writing the scripts yourself: in the batch file I use subst to shorten the paths.  Some mp3 albums have very long titles, which translates to long path names.  I do this as a habit going back to the xcopy days.  Xcopy would give its infamous “insufficient memory” error if the file path was greater than 256 characters. (Note this has nothing to do with memory, free memory, or the total size of the copy – as you’ll be told all over the web.  This error is only ever about the length of the file path at the point of the error.  Its just a badly written error message.)  Now, I don’t know if robocopy has this problem – but I don’t know it doesn’t, so why take chances to save a couple of lines in a script?  I don’t want to find out that much.

So, something like this:

subst x: c:\music
subst y: “f:\backups\music”

[subst the two folders as drives, if need be, use quotes for long file paths, e.g. "c:\documents and settings... etc"]

robocopy x: y: /mir /copyall /xo /TEE /LOG+:”C:\backuplog.txt” /NP

[do the copy - remember robocopy copies directories, not files like xcopy, so \* is implicit.  /xo means don't copy older files over newer, /TEE and /NP are formatting, and /LOG+ appends to a log file.  Note that /mir means mirror - it will delete files from the backup set to match deletions from the master set.  Read the documentation if you don't want this - but I move files around sometimes and want mirror copies, not ever increasing duplicated backup directories.]

robocopy “C:\Documents and Settings\ … \My Music\iTunes” *.itl F:\backups\iTunes /copyall /xo
robocopy “C:\Documents and Settings\ … \My Music\iTunes” *.xml F:\backups\iTunes /copyall /xo
robocopy “C:\Documents and Settings\ … \Application Data\Apple Computer\iTunes” iTunesPrefs.xml F:\backups\iTunes /copyall /xo

[You should also backup the iTunes xml and preference files, and probably your other data while you're at it.  These are other robocopy lines for the iTunes settings files (with robocopy you add the actual filenames or wildcards after the copy to and from paths)]

subst y: /d
subst x: /d

[delete the subst's]

pause

[I like to add a pause so I can leave the backup running then come back and glance at the screen and check it finished without going into the logs].

So the final script:

subst x: c:\music
subst y: f:\backups\music

robocopy x: y: /mir /copyall /xo /TEE /LOG+:”C:\backuplog.txt” /NP

robocopy “C:\Documents and Settings\ … \My Music\iTunes” *.itl F:\backups\iTunes /copyall /xo
robocopy “C:\Documents and Settings\ … \My Music\iTunes” *.xml F:\backups\iTunes /copyall /xo
robocopy “C:\Documents and Settings\ … \Application Data\Apple Computer\iTunes” iTunesPrefs.xml F:\backups\iTunes /copyall /xo

subst y: /d
subst x: /d

pause

If you’re using two drives, use two scripts.  If you set the drive letters in the XP Computer Management’s Disk Management panel, they should stay put even after you swap them around.

With two drives, store one off-site.  That’s the point of this exercise – swap them over once a week or so.  That way, the one at home is current with everything, up to today, and the one at work or a friend’s house is only a week old if your house burns down and you lost your computer and the daily backups.

That’s all.  If you don’t do this, do something – even mass CD burns.  This is important!

WHAT I’M LISTENING TO: Piebald (on Amie Street here), melodic and slightly mournful indie pop that runs the gauntlet from Dylan-esque folk ponderings to something that’s almost like show tunes.  No longer free, when I just checked, but still only 9c or 13c a track and worth a listen just to see if its your kind of thing.

Leave a Reply