A hard time excluding a directory

EDIT

Never mind, my problem is this: How append --exclude argument dynamically to restic command? .

I think I have a “simple” problem, but I really cannot get it to work :slight_smile: . What I want is this: I want to backup everything inside /srv/local, but I want to exclude one specific directory. This is my restic full command:

restic backup --exclude "chromium-container/data/**" --cleanup-cache  /srv/local

I still see the contents of chromium-container/data/ being backupped. I also tried a few other exclude patterns, for example:

  • specifying the full path: “/srv/local/chromium-container/data/“
  • wildcard tests: “/srv/local/chromium-container/data/*“
  • wildcard tests: “/srv/local/chromium-container/data/**“
  • remove last slash: “/srv/local/chromium-container/data“
  • etc.

I just cannot tell restic to ignore the contents of this directory. Who can help me? I’m using restic 0.18.0 compiled with go1.24.4 on linux/amd64.

So did you solve this? If not, you might want to consider using an exclude-file as described here. You could dynamically generate that file before every backup run.

Hey @nicnab , thanks! This is indeed exactly what I ended up doing. All that fighting with how vars are being interpreted isn’t really what I like to do :slight_smile: .