The cloud service I'm using has case-sensitive files. On Windows, you can set a directory to allow for case-sensitive files, but it's a bit of a pain in the ass.
As part of the script I'm working on, I would like to have rclone check to see if there are filenames on the remote server that have the same name but in different cases—without initiating any sort of download—and list what those conflicts are.
Rclone has these flags to help with case sensitivity. By default a sync to a windows local filesystem will force a case insensitive sync.
Global Flags:
--ignore-case Ignore case in filters (case insensitive)
--ignore-case-sync Ignore case when synchronizing
Backend Flags:
--local-case-insensitive Force the filesystem to report itself as case insensitive
--local-case-sensitive Force the filesystem to report itself as case sensitive
If you use a case insensitive sync then rclone will assume FOO and Foo are the same file which is generally what you want.
However if you have a file called FOO and Foo in the same directory in the source and you do a case insensitive sync, you'll get a warning
2022/03/03 09:28:47 NOTICE: Foo: Duplicate object found in source - ignoring
So grepping these out is probably what you want.
If you run with --dry-run you will still get the NOTICE but nothing will be transferred.
If you run with --dry-run you will still get the NOTICE but nothing will be transferred.
Ah, perfect! Thank you.
I can combine this with rclone copy remote: local: --create-empty-src-dirs --fast-list --exclude "{*.*,*}" to create the directory structure in advance, since Windows – annoyingly – makes you enable case-sensitivity on a folder-by-folder basis with no option for inheritance or recursion.