I’m trying to filter remote directories and move them to a subdirectory with the corresponding first letter, i.e. /MyFolder, /MoveMe, /MatchingFolder -> /M/ - basically trying to organise all my media folders based on their first letter. The problem is that by default --include /{M*}/ includes the subfolder itself so rclone gives error that remotes overlap. So I thought --exclude to the rescue with --exclude /M/. The problem is that I can’t get it to work.
The exclude works on it’s own, without the include, but not after the include. So see this example:
Due to the command line config parser I use, it parses all the --includes before the --excludes (or maybe the other way round), so this won’t work. It does say this in the docs, but maybe it isn’t obvious enough!
Anyway, use --filter '- /M/' --filter '+ /{M*}/' instead and it will work fine hopefully.
What I should probably do is make a warning - not sure why I didn’t think of that before! I made an issue.
Ah! Yeah I did read all the filter docs and I understood it to mean: first --includes and then --excludes are redacted, including from the --includes. I did try with the filters but same result due to misunderstanding
@ncw Sorry, I just can’t get the --filter working at all. The include works as it should, but not --filter. Here’s the command I run and it outputs every single directory, not just starting with ‘M’:
rclone: Version "v1.38" starting with parameters ["rclone" "lsd" "STORM-CRYPT:Media/Plex/Films" "--filter" "+ /{M*}/" "-vvv"]
I’m assuming --filter works with directories, as well as files?
edit: in contrast, this lists only directories starting with ‘M’ : rclone lsd STORM-CRYPT:Media/Plex/Films --include /{M*}/
edit 2: Argh, I can’t get the move command to work even with the --include:, what is wrong with this command?: rclone move STORM-CRYPT:Media/Plex/Films STORM-CRYPT:Media/Plex/organise/A --include '/{A*}/' -vv --dry-run
Every single directory gives Excluded from sync (and deletion), including those starting with A