C-Command Software Forum

Rsync and create date

I have two macs (iMac and MBP) and use rsync to synchronise the library between these two computers and my server. I have been adjusting the create date for a number of items on the iMac and synced the library to the server (after quitting EF). When I restart EF again, the create date is correct. Now I use rsync to copy the library to my MBP and the create date is not changed.

I’m using the following command:

backup: rsync -avP <local> <remote>
restore: rsync -avP <remote> <local>

The server is running FreeBSD 9.2 with rsync 3.1.0, on the OSX systems I’m running rsync 3.1.0 from Homebrew. Am I missing something to get the proper create date? I’ve checked the actual files on my iMac and they also have an incorrect create date (using “ls -l”) but the extended properties (Cmd-I) show the correct creation date. Adding “-X --times” to the rsync commands doesn’t make a difference.

What you’re missing is that the Unix layer (“ls”) and FreeBSD don’t understand the notion of Mac creation dates. (The Unix “ctime” has a different meaning.) If you’re rsyncing between two Macs, you can probably preserve them using the “–extended-attributes” option. I’m not sure whether the FreeBSD version of rsync supports that.

Both the Homebrew and FreeBSD version support extended attributes option (-X or --xattrs) but this doesn’t seem to work. I will try again tonight after I have moved the old backup aside and start fresh.