How to include only 1 directory in rewrite command

How to include only 1 directory in rewrite command and exclude every other directory?

1 Like

Use the exclude-file flag.

For the exclude file itself, if you have 5 directories and you want to include only one, just list the other 4:

Dir1
Dir3
Dir4
Dir5

Now you are only including Dir2.

If the directory you want to keep is a subdirectory, then:

Maindir/*
!Maindir/subdirIwant
2 Likes

See PR 5191, which is in the make. Once it has been approved, this should be easy: restic -r … rewrite --include .