The idea is to exclude all the content of the Master directory, while at the same time include the Master/Courses/Done/Cryptography/ directory. From the latter, I want to exclude the Rec/ subdirectory. However, the Cryptography directory is not synced at all, so I suspect this is not the way to proceed.
I tried to replace the last slash / with ** in the Master line, i.e. /University/PoliMi/Master**, but nothing changed. So, what is the correct way to exclude a whole directory, except for some specific subdirectory? I couldn't find any example in the documentation.
What is your rclone version (output from rclone version)
rclone v1.54.1
- os/arch: linux/amd64
- go version: go1.16
Which OS you are using and how many bits (eg Windows 7, 64 bit)
ArchLinux 64-bit
Which cloud storage system are you using? (eg Google Drive)
OneDrive for Business
The command you were trying to run (eg rclone copy /tmp remote:tmp)
rclone ls polimi: --filter-from file.txt
The rclone config contents with secrets removed.
[polimi]
type = onedrive
region = global
drive_type = business
A log from the command with the -vv flag
Not sure if it's useful, I guess is more me failing in understanding how filters work, but if it can be useful I will provide one.
filter can be very confusing
i think there are two ways to get this done
first way is to change the order of items in the --filter-from
based on the docs
"Within --include-from, --exclude-from and --filter-from flags rules are processed from top to bottom of the referenced file."
second way
filters are applied in a certain order of precedence, you can read about it here
"The order in which rules are processed can influence the result of the filter."
add a --include-from for /University/PoliMi/Master/Courses/Done/Cryptography/
remove /University/PoliMi/Master/Courses/Done/Cryptography/ from the --filter-from
Hi @asdffdsa , thanks for your reply.
I prefer the filter method in order to avoid passing different flags from the command line each time and as a quick reference. I indeed tried the first way, but there's no difference.
Filters work on a first matched basis so if you match something, no further filters are applied:
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.
You'd want to put your most restrictive / specific matches on the top and work your way down to the least restrictive since the first match stops the rules processing.