It’s comfortable to have home user directory as one snapshot.
But there are a lot of directories don’t need to be stored, but need to be stored partial.
For example, I have some git repositories — I don’t need to include git files and workfiles from git bases, but need some files and directories from that, placed inside.
Same for snap or flatpak packed apps: I want to exclude from snapshot upper level directory, but want to include some files and subtrees inside excluded directory.
Rules are set in KopiaUI, Policy/Files. Syntax is the same as gitignore site shows.
E.g My example was taken from my backup literally (minus comments in the bracket of course). Best way to test, is a set a few rules and use “Estimate” button, to see outcome.
work as I need: I got in snapshot file armbian/.git/config and armbian/userpatches folder with content.
Then, the border is more than one folder deep for exclusion:
if path is “a/b/c”, then it’s possible to exclude “a” but get back “b/c”. but impossible to exclude complete “a” but include “a/b/c”.
Hm, this filter should work. Kopia filters are case sensitive (even in the Windows) so if there are upper/lower cases in the path… filter should reflect that.
You can exclude or include any directory form given tree, but this may required more careful unrolling filter rules. So, sometime it is simpler to just add single directories, one by one, to the repository. Maybe not so elegant, but works.
An optional prefix “!” which negates the pattern; any matching file excluded by a previous pattern will become included again. It is not possible to re-include a file if a parent directory of that file is excluded. Git doesn’t list excluded directories for performance reasons, so any patterns on contained files have no effect, no matter where they are defined.
Why, why .gitignore syntax there??! It was not designed for a backup set definition use.
Duplicati have much better format for source set.
Also, you can always use .kopiaignore file for fine-tune your filters. I’m also using Duplicati, Kopia just “requires” different thinking about your backup “architecture”, because Kopia filters are exclude (ignore) ones (for now anyway).