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

Hi,

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

tmp/
torrents/

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:

photos/

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

Why is this?

Thanks,
Christoph

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!