Rsync keeps copying the same file

Solution 1:

To summarize the comments: rsync does not handle the transfer of files between a case-sensitive filesystem (typically used on Unix/Linux), and a case-insensitive filesystem (typically used by Windows and MacOS).

When 2 different source paths (eg d/x and d/X) are the same after notional conversion to, say, lowercase, then rsync does not notice, and may transfer d/x, then overwrite the same destination file with d/X. If the files do not contain the same data, and have the same timestamp, the files will always be updated on future rsync runs.

There does not seem to be any solution proposed by rsync. One can identify potential problems by going through the source files to list the ambiguities:

find . | tr '[:upper:]' '[:lower:]' | LC_ALL=C sort | LC_ALL=C uniq -d

Alternatively, a case-sensitive destination can be created.