Bug report: rsync does not always discriminate upper and lower
case
Jim Salter
jim at jrssystems.net
Sun Dec 28 11:39:08 EST 2003
JW: in this instance, since he used the -a switch, shouldn't have rsync
sync'ed the file again anyway, since the file modification date would
(should?) have been updated when he renamed the file?
Alain: *does* Panther "touch" the file (and update the file modification
datestamp) when you rename it?
-J
jw schultz wrote:
> On Sat, Dec 27, 2003 at 12:28:06PM +0100, alain content wrote:
>
>>Hi,
>>I found this surprising behavior with rsync (version 2.5.7 protocol
>>version 26) on Mac OS X (Panther, 10.3.2) :
>>
>>Suppose you have a folder "Source" containing a file named "abc", and its
>>backup as folder "Clone", created by rsync :
>>
>>rsync -a ~/Desktop/Source/ ~/Desktop/Clone
>>
>>
>>Now change the name of file "abc" into "ABC" and re-sync :
>>
>>rsync -av ~/Desktop/Source/ ~/Desktop/Clone
>>
>>
>>>building file list ... done
>>>wrote 141 bytes read 20 bytes 107.33 bytes/sec
>>>total size is 6148 speedup is 38.19
>>
>>Not good : the change has not been done !
>>And suppose you do this:
>>rsync -av --delete-after ~/Desktop/Source/ ~/Desktop/Clone
>>
>>>building file list ... done
>>>deleting a file named abc
>>>wrote 145 bytes read 20 bytes 330.00 bytes/sec
>>>total size is 6148 speedup is 37.26
>>
>>Much worse, the file is not preserved in the backup.
>>There is a workaround though :
>>
>>rsync -av --delete ~/Desktop/Source/ ~/Desktop/Clone
>>
>>>building file list ... done
>>>deleting a file named abc
>>>./
>>>a file named ABC
>>>wrote 181 bytes read 36 bytes 434.00 bytes/sec
>>>total size is 6148 speedup is 28.33
>>
>>However, the behavior is inconsistent and can result in incomplete copies or
>>backups.
>
>
> That sounds like a filesystem that preserves case but is
> insensitive to case.
>
> Rsync uses lstat to see if a file exists. On case
> insensitive filesystems lstat("abc", buf) will succeed if
> the correct name is "ABC". In other words, it isn't rsync's
> fault if it believes the OS when the OS lies.
>
> Case insensitive filesystems are not safe destinations for
> rsync because if two paths exist with only a difference in
> case ("Mail" and "mail") they will conflict.
>
> There might be an option to mount the filesystem with case
> sensitivity turned on. Using that option would fix this
> problem.
>
More information about the rsync
mailing list