Macos – How to copy Time Machine volume to another disk using rsync while preserving ACLs

aclmacosrsync

Recently I had to change my Mac's filesystem from case-preserving to being fully case-sensitive. I did that by using CCC and copying data to another disk, then returning back to newly formatted main disk.

Now, I wanted to do the Time Machine backup on my old Time Machine disk, that is hosted on my FreeBSD based NAS, exported through AFP. However, I'm getting an error that filesystems do not match, as Time Machine still has non-case-sensitive fs. This time, I can't use CCC, as it doesn't support file level copy for Time Machine volumes.

Naturally, I went straight for rsync, but that raises a problem – if I run it with:

/usr/local/bin/rsync --super -aEHAXNvx --fileflags --delete /Volumes/Time\ Machine\ Backups/ /Volumes/NewDisk/

it starts complaining as soon as it hits Backups.backupdb/<machinename> folder, with failed to set permissions, operation not permitted. The problem here is copying ACLs, that are quite restrictive:

 ll -dle /Volumes/Time\ Machine\ Backups/Backups.backupdb/<machinename>/
 drwxr-xr-x@ 19 root  staff  646 Dec 23 09:38 /Volumes/Time Machine Backups/Backups.backupdb/<machinename>/
 0: group:everyone deny add_file,delete,add_subdirectory,delete_child,writeattr,writeextattr,chown

So, I removed -A from the above command, and rsync is now happily moving GBs of data.

Alas, I would like to preserve ACLs as well. Is that possible somehow? OS X doesn't have getfacl/setfacl, and I would like to avoid parsing output of ls -le. What I see as a solution here is to somehow tell rsync to apply ACLs "backwards", that is, from leaf files down to directories, but there's no option for it.

Best Answer

Download rsync version 3 using Homebrew. Then you can try the "--acls" option. The rsync on Mac seems to have a slightly different command line syntax from other operating systems. You probably want to take a look at this link: http://nicolasgallagher.com/mac-osx-bootable-backup-drive-with-rsync/. It describes how to get rsync 3 and the command line arguments he uses.

I'm not an OSX user, but I back up my wife's Mac to a Linux server with rsync.