Forcing rsync to convert file names to lower case

case-insensitivefilesystemsrsync

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.

Best Answer

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 the tr or rename command could do the job...

# Examples - Don't run directly
`rename 'y/A-Z/a-z/' *` # would change case on files within a directory.