File copying/synchronization software and your metadata (and data!)
Following up on my earlier test of Mac archiving software, I decided to test some popular file copying/synchronization software to see which of these programs kept metadata and other Mac/HFS+ attributes intact. Rather than do a comprehensive test, I tried some popular utilities which seem to cover the general breadth of the software and which are particularly popular or prevalent. I also wanted to catch programs which had been updated since this article was written a year ago.
If you want detail on other utilities, I recommend reading the article linked above, or doing your own tests if you have the time. (And please let us know what you find out!)
The Finder: I just did a simple copy from one disk image to another. Drag and drop. For what it’s worth, an AppleScript copy via The Finder has the exact same results.
Disk Utility: Disk Utility does a pretty good job when making an image from a device, but I was more curious about how it would do making an image from a folder. So I simply chose “New Image From Folder…” and let ‘er rip.
cp: The venerable copy command on the command line. Apple’s updated it to respect resource forks and other metadata.
hard link: This is simply using the ln command or the Gnu cp command to create a separate instance in the logical directory of a file. This is a way to make a file literally exist in two places, where neither version is a pointer or alias to the other. This can be done with the ln command or the Gnu cp command (part of the gnu coreutils).
rsync: Rsync is a great and lightning fast synchronization utility that’s at the core of many command-line backup systems. Apple’s updated it to support resource forks and whatnot, but unfortunately, they broke it in the process. I ran a patched version installed via Fink as the other version pretty much doesn’t work at all.
ditto: This is Apple’s answer to rsync, as best as I can tell, and it’s a nice way to quickly duplicate folders and files. It’s been resource-fork-aware from the start.
psync: psync is a Perl-based utility that does file synchronization similar to rsync. A few graphical clients (such as Deja Vu) use psync on the back end.
CCC 3.0 b5: Carbon Copy Cloner is a great utility for cloning your hard drive. The 3.0 branch is brand new, so I thought I’d give it a try and see how it did.
SuperDuper!: Shirt-Pocket Software’s utility is a fave among many folks who like having a bootable backup. While somewhat inflexible in how it works (it’s pretty much geared toward being a whole-drive duplicator), it’s easy to use and very reliable.
ChronoSync: ChronoSync is probably the most configurable and powerful graphical synchronization utility available for the Mac. It’s users rave about it, so I figured I’d include it in my tests.
Result of tests of file copy/synchronization software
Tool inode number permissions ACL BSD flags resource fork extended attributes type creator creation date modification date lock stationary invisible label comments Finder copy N Y Y Y Y Y Y Y Y Y Y Y Y Y Y Disk Utility Image N Y N N Y N Y Y N Y N Y Y Y Y cp -r N N N N Y Y Y Y N N N Y Y Y Y hard link Y Y Y Y Y Y Y Y Y Y N Y Y Y N rsync -aE N Y N N Y Y Y Y N Y N Y Y Y Y ditto N Y N N Y N Y Y N Y N Y Y Y Y psync N N N Y Y N Y Y Y Y Y Y Y Y Y CCC 3.0 b5 N Y N N Y N Y Y N Y N Y Y Y Y SuperDuper! N Y Y Y Y Y Y Y Y Y Y Y Y Y Y ChronoSync N Y Y Y Y Y Y Y Y Y Y Y Y Y Y
- Finder Copies: Comments are maintained even when the invisible .DS_Store file is not copied, unlike most other techniques
- Disk Utility Image: Attempting to build an image from a folder on a volume with ACLs enabled will fail. As a result, these tests were carried out on a folder without ACLs.
- hard link: Files with the uchg flag/locked files could not be linked and were skipped
- rsync: Attributes in bold were only successfully copied from a volume with ACLs disabled. With ACLs enabled, these attributes do not copy.
- psync: Psync didn’t copy extended attributes, but it did embed the file’s type/creator information into a new extended attribute. Very strange behavior.
- SuperDuper!: SuperDuper! maintained the “arch” BSD flag on the clone. While this is not technically correct, it is thorough, and may be desirable if you want a precise clone.
- ChronoSync: ChronoSync has an option to maintain Finder comments even when you aren’t copying invisible .DS_Store files
Clearly, The Finder is your only free and bulletproof solution to copying files. Every command-line option, despite Apple’s efforts to make them compatible with all the fancy Mac metadata, has serious failings.
If you’re willing to spend a little money, SuperDuper!, or ChronoSync is a good option. Carbon Copy Cloner comes close, but even with its lower price (it’s donationware), SuperDuper! does a much better job and is quite reasonably priced.