--exclude-file *.extension behaviour confusing

I’m just getting started with restic, but I can’t seem to exclude files. Here’s how I run the backup:

restic backup -r therepo --verbose 
--exclude-file="/home/me/.config/backup/restic-excludes" 
--files-from="/home/me/.config/backup/restic-includes"

This runs without errors. inside restic-excludes is

# don't save videos
*.avi
*.mp4
*.mov
*.wmv
*.wma
*.flv
*.ogg
*.mpeg
*.mpg

and inside restic-includes is a list which I recognize when I look at Paths running restic -r therepo/ snapshots.

However, when I do:

estic -r therepo/ restore ab478bc7 --target tmp/restore

and navigate inside the tmp/restore I find videos with .avi format. More bewildering, if I run

restic -r therepo/ ls ab478bc7 | grep .avi

I don’t see any lines with .avi endings (only some partial matches like savings.txt or such.

So I’m very confused.

  1. The files don’t seem to be there when I list them
  2. The files should be excluded when I run the backup

so How are the files restored? and how can I further diagnose what is happending?

Is it possible that this is not specific enough? Does it need the double **.avi to say

look into all subdirectories and ignore .avi files in there?

Try without the double quote. Your exclude file looks okay. For me the backup script and the exclude file are in the same directory…

restic -r ./browsers --verbose backup --tag daily --exclude-file=exclude_browsers -p ./pass --files-from target_browsers

The ls command is not recursive by default, so if the avi files are in a subfolder then ls won’t list those. For recursive listing you have to run restic ls --recursive.

The excludes file seems fine. If restic would be unable to read the exclude file, then it would abort the backup right at the start. What is the content of the includes files? Does it include the folder containing the avi file or a parent folder?

The double-quotes are already be removed by the command-line shell before restic get’s the command parameters.