If I am backing up a directory and wish to include all directories named foo
but not files named foo
, is there a way to specify that? With rsync
and git
, a trailing slash on a name makes it match only directories…
rsync -a --exclude=foo/ . /dest/
…but that doesn’t appear to work with restic (0.17.3); running restic backup --exclude foo/
excludes both files and directories named foo
.
I guess one could dynamically generate an exclude file with --exclude-file <(find srcdir -name foo -type d -print)
or something like that.