--include-from vs --exclude-from?


I’ve got a quick question.
I had an exclude file for --exclude-from with contents:


which worked fine. I now decided to include only one dir instead of exclude what I have right now.
Therefore created a file for --include-from with contents:


However, it doesn’t seem to work. Only if I use photos/**

Why is this?


rclone filters work on the whole path name.

So photos/ will match a directory called photos anywhere in the directory path. so it will match /a/photos and /b/photos

However it won’t match /a/photos/a.jpg - you need the ** to match everything including / characters.

I suspect you want /photos/** which will match the directory in the root photos and everything under it.

I expect you are now wondering why in your --exclude-from example tmp worked when what you really wanted was tmp/**? That is a consequence of rclone optimizing the directory access and not recursing into tmp because it was excluded.

I agree it isn’t entirely consistent though!