rsync backups on OS X

OS X El Capitan (10.11.4) comes with an outdated version of rsync (2.6.9) due to licensing issues. It's easy to build the latest rsync from source. I followed this guide, adapted for rsync 3.1.2.

cd ~/Desktop
curl -O
curl -O
tar -xvf rsync-3.1.2.tar.gz 
tar -xvf rsync-patches-3.1.2.tar.gz
cd rsync-3.1.2
patch -p1 < patches/fileflags.diff
patch -p1 < patches/crtimes.diff
patch -p1 < patches/hfs-compression.diff

Once rsync is built, you can optionally run sudo make install to put the binary in /usr/local/bin.

Patches for OS X

fileflags preserves the st_flags stat() field (see sys/stat.h). Adds --fileflags option, as well as some --force-* options.

crtimes preserve create times. Adds --crtimes (-N) option.

hfs-compression adds support for HFS+ compression. Adds --hfs-compression and --protect-decmpfs options. A diff of the --help output between standard and patched versions of rsync.

Testing your rsync arguments

Backup Bouncer is useful for verifying your rsync arguments. I used the fork by mbaltaks, which seemed to have more recent fixes and updates. The test files bbouncer creates utilize basic permissions, timestamps, symlinks, symlink ownership, hardlinks, resource forks, finder flags, finder locks, create dates, BSD flags, extended attributes, HFS compression, and ACLs. You can decide which you want to preserve and experiment with different rsync options until you're satisfied.

./bbouncer create-vol mysrc
./bbouncer create-vol mydst
./bbouncer create /Volumes/mysrc/
rysnc --your-options /Volumes/mysrc/ /Volumes/mydst/
./bbouncer verify -d /Volumes/mysrc/ /Volumes/mydst/

A simple rm -rf may not be able to delete the test files bbouncer creates. Use the clean command instead.

./bbouncer clean /Volumes/mydst

rsync options

Here's what I currently use to backup my files to another HFS+ disk. These arguments pass all of the bbouncer tests, though that's not required depending on your backup strategy.

rsync -aNHAx --hfs-compression --force-change --delete
  • a archive mode (--archive), equivalent to passing -rlptgoD
  • N preserve create times (--crtimes)
  • H preserve hard links (--hard-links)
  • A preserve ACLs (--acls)
  • x don't cross filesystem boundaries (--one-file-system)
  • hfs-compression transfer xattr (compressed file) instead of decompressed file, if supported
  • protect-decmpfs transfer decmpfs xattr instead of decompressed file regardless of support at destination
  • force-change disables user- and system-immutable flags on files being updated/deleted in destination. If omitted, rsync may fail to set times on some files depending on their flags.
  • delete remove extraneous files from destination

Note that hfs-compression and protect-decmpfs imply the following options:

  • X preserve extended attributes (--xattrs)
  • fileflags update destination files with same file-flags (see chflags command) as source

This is equivalent to the command above, but includes implied options for clarity:

rsync -aNHAXx --fileflags --hfs-compression --force-change --delete

Another world, another time

In the age of wonder, our books were made of paper. I love the way my old books smell. It seems to be some quality of the paper, the ink, and perhaps even a bit of Mom's old cigarette smoke.

I pick one off the shelf every now and then to read through it. Most of the books Michelle and I have are high school and college era. I typically kept my receipt to use as a bookmark. A part of me looked forward to the nostalgia of looking at it again.

I'm surprised my copy of Walden is nearly 20 years old now. I bought it for a couple dollars at the now-defunct Media Play in Morrow, whose phone number didn't need to include an area code, with 5% sales tax. The receipt is printed on a dot matrix. For some reason I actually had $2.31 in cash too.

The Wild West

Part of the fun of going to Las Vegas is leaving Las Vegas.

At the very least we typically drive the scenic loop at Red Rock Canyon and walk some of the trails.

Ah, back to the air conditioned halls, cigarette smoke, and perfumes. It's own kind of refreshing. See more in the auto-generated photo story on Google+.

Zion from AZ-389 N

Michelle took this picture of Zion from the car as we were driving back to Las Vegas. She looked at her phone after taking the photo and was disappointed that it didn't capture the expansive view. I like the way it turned out, especially with the road stretching toward the horizon on the left. Drop the Maps guy around Cherry Ave to check it out.

Tips on driving a Honda Accord in snow

Yesterday cars started filling the roads outside my window around noon. As the hours passed it got worse. Initially concerned that Michelle couldn't leave her ER shift until 5pm, I started to think that might be a good thing.

The last major snow storm in Atlanta was in 2011. We were living in Augusta at the time and didn't have to worry about it. After witnessing the second fender bender in a couple hours on the street below, I decided I needed to review some safe snow-driving literature.

Our 2003 Accord has an automatic transmission. There are a handful of shift lever positions, but we've never needed anything but (D), Drive.

I tried to figure out whether I should tell her to use 2 or D3 on the way home. I came across dozens of forum posts with conflicting information. Everybody knows something on forums. I wanted something definitive.

Eventually I found the owner's manual, so here's a summary. This is applicable to 2003-2007 models, maybe some others (the new 2014 Accords have different shift positions).

Drive (D)

Normal driving. The transmission automatically selects a suitable gear for the vehicle speed and acceleration.

Drive (D3)

Similar to D, limited to first 3 gears. Use when towing a trailer in hilly terrain or to provide engine braking when going down a steep hill. D3 can also keep the transmission from cycling between third and fourth gears in stop-and-go driving.

Second (2)

This position locks the transmission in second gear. It does not downshift to first gear when you come to a stop. Use second gear for more power when climbing, to increase engine braking when doing down steep hills, for starting out on a slippery surface or in deep snow, to help reduce wheel spin, and when driving downhill with a trailer.

First (1)

To shift from Second to First, press the release button on the bottom of the shift lever. This position locks the transmission in first gear. By upshifting and downshifting through 1, 2, D3, and D, you can operate this transmission much like a manual transmission without a clutch pedal.

Quite a few forum posts claimed Second (2) restricted the transmission to gears 1 and 2, which is clearly incorrect (as it turns out, the meaning of the positions vary by manufacturer). Another person claimed you get more torque at higher gears. That's one of the reasons I decided to write this.

The reason Second (2) helps with slipping in snow is that it produces less torque (force) at the wheels than first. The snow and ice reduce traction (the maximum force from the adhesive capability between tire and ground), and the hope is that Second will keep you from exceeding the traction the icy road can provide. If you do exceed it, the wheels slip.

Yesterday, in Atlanta, it took Michelle almost 2 hours to make the 4 mile drive home from the hospital. A good 50 minutes of that was spent traveling a single block by West Peachtree and 10th St due to a broken down bus and people blocking the intersection trying to get to the highway. She drove in second gear the whole time.

Saving a bird after it hit a window

Michelle's working the wards this month, so we're often up before the sun. I walk the dogs while she drives to work. This morning I spent a little more time than usual strolling and letting the dogs sniff all the things club-goers dropped on the ground last night, enjoying the suddenly cool temperature and low humidity.

As I was approaching the entrance to our building I heard a noise above and then saw a bird fall on the sidewalk twenty feet away. The dogs were naturally excited. Fitz sat down; he knows I give him things when he sits patiently.

I assumed the bird died but noticed its feet, pointed toward the sky, twitching slowly as we passed.

I fed the dogs and put them in our bedroom so they wouldn't freak out about me leaving and went back downstairs to try and move the bird. I couldn't find a shoebox but I had a Godiva bag with some tissue paper in it.

Luckily no dogs had been out since we had come up; the bird was just a few feet from the door and would be the first thing any dog saw on its walk. Good morning!

The bird was back on its feet but seemed stunned and wouldn't fly. I moved the bag towards its body and managed to get it inside.

I brought the bag upstairs and set it on the balcony. I didn't touch the bird but sanitized enthusiastically after this, just to be safe.

A couple hours later, it flew away into the tree next door. Happy ending.