alain content
2003-Dec-27 22:28 UTC
Bug report: rsync does not always discriminate upper and lower case
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.19Not 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.26Much 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.33However, the behavior is inconsistent and can result in incomplete copies or backups. Alain Content, Brussels
jw schultz
2003-Dec-28 08:36 UTC
Bug report: rsync does not always discriminate upper and lower case
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. -- ________________________________________________________________ J.W. Schultz Pegasystems Technologies email address: jw@pegasys.ws Remember Cernan and Schmitt
alain content
2003-Dec-28 20:45 UTC
Bug report: rsync does not always discriminate upper and lower case
Right, Renaming does not touch the file - it only changes the directory modification date. And you are absolutely right. Panther preserves case but is insensitive to case in file names : ls>... >-rw-r--r-- 1 ac ac 0 27 Dec 11:59 a file named ABCfiletest -e "a file named ABC"> 1filetest -e "a file named abc"> 1Bad, bad Apple.