Exclude fixed name not working as per docs / regexp

I have seen a number of other threads on exclude here. This one is different and a little simpler perhaps;

I have

rclone sync -n --dump-filters --delete-before --exclude Thumbs.db --exclude .dropbox.* --include-from rclone-amazon.txt F: amazon:

The filter output (for all excludes) says:

  • (^|/)Thumbs.db$
  • (^|/).dropbox.[^/]*$
  • ^.*$

But those regexps are not working the way they should (or the docs say):

http://rclone.org/filtering/

file.jpg - matches “file.jpg”
- matches “directory/file.jpg”
- doesn’t match “afile.jpg”
- doesn’t match “directory/afile.jpg”

and yet…

Transferring:
* Music/Compilations/Dubitamin/Thumbs.db: 100% done, 0 Bytes/s, ETA: 0s
* Music/Artists/Brennan, Máire/Máire/Thumbs.db: 100% done, 0 Bytes/s, ETA: 0s
* …nology; Journeys Into Outer Bass/Thumbs.db: 100% done, 0 Bytes/s, ETA: 0s
* Music/Artists/Brand New Heavies, The/Brother Sister/Thumbs.db

Windows, rclone v1.35

UPDATE: Changing the order of the --include-from and the two --excludes makes no difference

Thanks

OK, maybe my bad reading skills;

–include-from

This adds an implicit --exclude * at the very end of the filter list. This means you can mix --include and --include-from with the other filters (eg --exclude) but you must include all the files you want in the include statement. If this doesn’t provide enough flexibility then you must use --filter-from.

So, because my --include-from has /DIR/** this overrides the --exclude?

My question becomes one of help! how do I order these right to get what I want? Is it even possible?

I think I have understood now, I put everything in a single --filter-from file and it now appears to do what I wanted.

- Thumbs.db
- .dropbox.*
+ /Archive/**

+ /Videos/**
- *

I’ll leave this here in case it helps someone else.

1 Like

I think the solution you came up with is the best.

rclone is a little less flexible than rsync in that it doesn’t process the includes and excludes in the order of the command line - this is to do with the command line parser.

You could also write the --filter-from file as multiple --filter command line flags. I think the files is easier to maintain though.