Sorry for the confusing title, but I'm using rclone to back up 2 critical folders on the root of my drive:
- /opt
- /root
In the future I will need to add more, but for now, those two are the most critical.
So I initially decided to use --include-from. But then I needed to exclude certain directories inside /root, so I thought about using --exclude-from as well. This is not recommended per the docs, so I moved on to --filter-from.
Here's what I have so far:
> rclone sync / gdrive-opt: --track-renames --copy-links --log-level INFO --log-file /path/to/log --drive-use-trash --filter-from /path/to/filter.list --dry-run
Here's the filter.list
# Filter list for root backup # Baseline, exclude all directories - /** # But only backup these matches + /opt/** + /root/** # and exclude these - /root/path/to/excludedfolder/**
But this basically matched the first rules and then stopped processing the rest. How can i accomplish this process of including only specified directories and excluding some directories below those included directories?