Time Machine vs Carbon Copy Cloner

So I recently decided to switch from Time Machine, OS X’s built in backup solution, to CCC. 

Time Machine often had trouble finding my network volume I was using for backup, due to a lack of advanced config options, and I never liked the way it wouldn’t tell you “exactly what it was doing”. I’ve successfully restored massive TM backups before, but the weird Dr. Who style interface always scared the shit out of me quite frankly. I want my backup software to look rock solid, not like it’s done acid!

Enter Carbon Copy Cloner. First thing I didn’t know: it uses Sparse Bundle backups just like Time Machine! These are disk images broken up into lots of small files, which is great for handling diffs and stuff if you want to do incremental backups (which CCC can do too) and send them off site. My NAS backs up to Amazon Glacier, so obviously if each backup changes a single 500GB file, this would be bad… 

 Big difference with CCC though: I can directly mount the resulting image! So while TM would churn through my backup just fine, I never had a decent way to verify what it had done. Just its weird Dr. Who interface… CCC lets me see the full contents of the backup directly. Another advantage: I can actually specify a username and password for the network share I want to backup to. Something TM always struggled with.

So yeah, quite happy with that! CCC: Like Time Machine but with less acid and more control. 😉



Converting Traktor NML Playlists to M3U with Ruby

There didn’t seem to be a way to do this on OSX / Mac so I thought I’d write a quick script. I have a lot of playlists in Traktor that I’d like to use else where, for instance on my phone and in VLC. The trouble is, NML is a proprietary format to Traktor. Luckily, it’s XML based and the M3U format is incredibly simple (just a list of file paths). So:

[ruby]

#!/usr/bin/env ruby

# Convert Traktor NML playlists to M3U

require "rubygems"
require "nokogiri"

f = File.open(ARGV[0])
@doc = Nokogiri::XML(f)
f.close
m3u = File.new(ARGV[0]+".m3u", "w+")

@doc.xpath("//LOCATION").each do |location|
volume = location.xpath("@VOLUME").to_s
dir = location.xpath("@DIR").to_s
file = location.xpath("@FILE").to_s
dir.gsub!(//:/, ‘/’)
m3u.write("/Volumes/"+volume+dir+file+"n")
end

m3u.close
[/ruby]

Voila! Make sure you have the nokogiri gem installed –  we need this to handle the XML. Save the above script somewhere, make it executable with chmod o+x nml_to_m3u.rb then run it with your NML file as an argument:

[bash]./nml_to_m3u.rb ~/my_playlist.nml[/bash]

It’ll write an M3U playlist to a new file in the same folder.

Note: If you’re making these playlists for another device, you may need to alter the paths a bit. M3U can take relative paths, so if you’d exported your Traktor collection to another folder, you could just change the output line to:

[ruby]m3u.write(file+"n")[/ruby]

and drop the resulting file in with all your exported MP3s. Hope that helps someone somewhere!