Fixing Extremely Slow rsync on OS X

Last night I moved out my photo collection from my MacBook Pro’s internal SSD to a neat little Samsung T1 USB3 SSD. And since Time Machine still can’t handle backing up external drives correctly (it removes the external drive’s contents from the backup when it is not connected), I created a small script to do the backup using the good old rsync.

Backup of the T1 goes to a dedicated AFP share on my FreeBSD server (shared using Netatalk). An Elgato Thunderbolt 2 Dock provides gigabit Ethernet connectivity for the MacBook Pro. I usually see file transfer rates in the 60MB/s – 110 MB/s range from this setup. So the 3MB/s average what rsync produced here was a bit shocking.

And the transfer rate jumped up to the usual range when I downloaded something from the Internet! And went down to 3 megs when the download finished…

It seems that the nine year old version of rsync included in OS X Yosemite can’t handle the OS’s network power management features correctly. When another app wakes up the net to full speed, it works fine, but rsync alone can’t do that.

The solution is embarrassingly simple: install rsync from the ports collection. Did that, updated my script, and presto, I suddenly get transfer speeds in the 50MB/s – 80MB/s range…

Backing up Lightroom with ChronoSync

ChornoSync is what I use on my Mac for backing up user data – including my images. Although I don’t use Lightroom nowadays as much as I used to, backing up the database is important. There’s one gotcha, however. Preview images are stored in something called a bundle. A bundle is a directory that OS X handles as a single entity. For the catalog named Something.lrcat the preview bundle is named Something Previews.lrdata. So if one single preview image is changed, OS X thinks that the bundle is changed and ChronoSync happily copies the entire multi-hundred-megabyte conglomerate, not just the changed (or new) previews.

There’s a simple solution to this issue, shown on the image below.

Check the Dissect packages checkbox on the Options tab, and the Previews bundle will be treated as a regular directory, and ChronoSync will just synchronize newly added or changed previews.