Priority ordering of exclude and include files

Posted here as I thought it may be more suitable for discussion.

It would be useful for restic to consider the order of includes and excludes (given via parameters) so that one could override the other. For example, I have a “global” exclude file which excludes backing up .msi files. However, there is one backup job I want to include .msi files, but continue obeying the global exclude file. With the current restic behaviour there’s no way for me to “re-include” *.msi and still use the global excludes.

If restic obeyed the order of the --exclude-files and --files-from, I’d be able to use the latter to re-include the *.msi files.

I don’t think restic supports “–include” for backup command at all.
The issue is tracked here:

Thanks! I did a search on the issues but somehow didn’t find that one.

Hi all,

I reactivate this post because I did’nt find a tip in the documentation (v0.16).

I’m using an include file with a set of paths and an exclude file with a list of patterns, with

backup --files-from include.txt --exclude-file=exclude.txt

Is there a way to indicate I want to backup a specific path (and all files in that directory) whatever the exclude file contains ?

Thanks a lot for your help.

The excludes are always applied after --files-from. Depending on you exclude patterns, it might be possible to use negative excludes, for example !/path/to/keep/