We are using rsync
to transfer some (millions) files from a Windows (NTFS/CYGWIN) server to a Linux (RHEL) server. We would like to force all file and directory names on the Linux box to be lower case.
Is there a way to make rsync
automagically convert all file and directory names to lower case? For example, lets say the source file system had a file named:
/foo/BAR.gziP
Rsync would create (on the destination system)
/foo/bar.gzip
Obviously, with NTFS being a case insensitive file system there can not be any conflicts...
Failing the availability of an rsync
option, is there an enhanced build or some other way to achieve this effect? Perhaps a mount option on CYGWIN? Perhaps a similar mount option on Linux?
Its RHEL, in case that matters.
You can change the case of the resulting filenames on the target server after the rsync. I wouldn't attempt to do this mid-transfer (in case you need to restart the copy). As for making the change on the linux side, you'd need to determine if there are any conflicts. You will also need to determine if you need the directory names' case to be changed. Will all names be unique? If so, an appropriate
find
script coupled with thetr
orrename
command could do the job...You can mount a case-insensitive file system. Look at this post.
Also, this page suggests creating a disk image of type
FAT32
and mounting it. The created fs will be case-insensitive such any Windows partition.Using such a solution will eliminate the need to convert all these millions of files to lower-case.
Not the most elegant solution, but you can use LD_PRELOAD to override the relevant system calls and force everything to lowercase. I thought it is fun so I did a little proof of concept and...
And here is the sample, which may take a few iterations to become good enough to sync the whole thing.