--filter-from missing -

Hi! Ive been reading the docs and searching for threads but i cant find my issue. So a new topic it is. Im using --filter-from to filter out directories. But some directories still gets downloaded even if i have - the.folder.name/**

Lets say i want to download all dir that starts with O but filter some of the O ones.

Then my filter file is

+ O*/**
- a.some.folder/**
- odddd/**
- Othisfolderwillgetdownloadedanyway/**
- Obutsomewillgetfiltered/**
- *

Ive tried with the - rules first and with the + rules first. But in my head i should start with + on top and - on the way down.
Am i doing something wrong or is this a bug?

filter.txt:

- /O1/**
- /O4/**
+ /O*/**
- *
$ rclone lsd .
          -1 2023-10-31 06:50:08        -1 A1
          -1 2023-10-31 06:53:14        -1 A2
          -1 2023-10-31 06:53:16        -1 A3
          -1 2023-10-31 06:50:11        -1 B2
          -1 2023-10-31 06:50:02        -1 O1
          -1 2023-10-31 06:50:03        -1 O2
          -1 2023-10-31 06:50:05        -1 O3
          -1 2023-10-31 06:53:56        -1 O4
          -1 2023-10-31 06:57:45        -1 O5

$ rclone lsd . --filter-from ../filter.txt
          -1 2023-10-31 06:50:03        -1 O2
          -1 2023-10-31 06:50:05        -1 O3
          -1 2023-10-31 06:57:45        -1 O5

Not a bug:) Filtering can be confusing at the first look but it works as intended.

As per docs:

Each path/file name passed through rclone is matched against the combined filter list. At first match to a rule the path/file name is included or excluded and no further filter rules are processed for that path/file.

so if your filter.txt is:

+ /O*/**
- /O1/**
- /O4/**
- *

every directory starting with O matches first filter + /O*/** and is included. And this is not what you want.

Again as per docs:

Arrange the order of filter rules with the most restrictive first and work down.

Thank you. I tried that order before but seems i did it wrong. Seems to be working now.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.