1

Rsync on Mac ( 3.1.2 or earlier ) does not seem to update symbolic links properly.

When I "push" from a client to a server, it automatically overwrites the server's symbolic link even when it is older.

For example :

serverA has link MASTER->myFile_v10

clientB has older link MASTER->myFile_v03

When I push to serverA, the more recent link gets overwritten leaving me with the older version :

serverA has link MASTER->myFile_v03

clientB has older link MASTER->myFile_v03

I have tried the --update and all variants of link arguments I could imagine.

The MASTER links and the underlying file myFile_v10 all have timestamps that are older than myFile_v03.

1 Answer 1

1

rsync doesn't normally attempts to keep the most recent data. It's only an alternative to cp and scp that avoids transfering identical copies of local data. You can use --update to keep the files with latest modification stamps, but it doesn't work for directories and symbolic links.

The easiest fix to your problem is to ensure that the data you need to synchronize is identical in both computers. Anything that's different should be placed in a different subtree. So, in your case, simply make MASTER link to an intermediary symbolic link outside the tree you are syncin', and that one can be different in each computer.

3
  • I don't think that's correct, the default is to compare using file sizes and modification dates and only when the --checksum is used then the data itself (or rather its checksums) are compared.
    – phk
    Dec 28, 2016 at 18:47
  • Indeed. I have fixed my answer. If it's the case, I'd appreciate if you could review your vote.
    – giusti
    Dec 30, 2016 at 17:41
  • Very nice. Done.
    – phk
    Dec 30, 2016 at 17:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .