[Solved] Excluding all but one subdirectory? (filter)

Hi, I’m trying to create a filter rule that excludes whole directory, except one subdirectory.

My filter is currently:
- /directory/**
+ /directory/subdirectory/**

But this does not work. Any obvious mistakes? I’m pretty new to rclone.

EDIT:
nm, I think I figured it out, and that the most specific dir needs to be first in the list. ie.

+ /directory/subdirectory/**
- /directory/**

Yes the filter rules are traversed in order from the top and the first matching one is used. So you want to put the more specific ones first as you’ve discovered.

1 Like