What is the best way to provide case insensitivity?

Wayne Davison wayned at samba.org
Sat Jul 15 06:41:58 GMT 2006

On Thu, Jul 13, 2006 at 02:35:07AM +0100, Steve A wrote:
> Is this still the only way to make rsync case insensitive, or is there a 
> smarter/built-in way that I don't know about?

That's the only way at the moment in the stock rsync.  You don't have to
maintain all those [Xx] elements manually, though -- just write a filter
for the file.  For instance, write all the patterns using lower case:

- *.gid
- *.lnk
- *.old
- *.temp
- *.tmp
- thumbs.db

and then do something like this:

    perl -pe 's/([a-z])/[\U$1\E$1]/g' <simple.txt >complex.txt

Or run that dynamically:

    perl -pe 's/([a-z])/[\U$1\E$1]/g' <simple.txt | \
       rsync -av --exclude-from=- src/ dest/

Finally, there is a diff in the patches dir named ignore-case.diff that
ads some case-ignoring logic to rsync.  You might want to check that


More information about the rsync mailing list