borg icon indicating copy to clipboard operation
borg copied to clipboard

make --exclude-if-present support shell-like patterns

Open erAck opened this issue 5 years ago • 2 comments

Yes, I checked docs, FAQ and open issues. Borg version: 1.1.10 on Fedora F31.

This is an enhancement request.

It would be nice if --exclude-if-present PATTERN was understood and not just --exclude-if-present NAME. That way

borg create --keep-exclude-tags --exclude-if-present sh:/path/**/.git /path ...

would backup everything under /path but if a git repository was present in any directory then only that repo and nothing else from the directory. Best also except if another subdirectory again has a .git submodule that subdirectory then again is backed up.

erAck avatar Jan 19 '20 17:01 erAck

Hmm, doesn't --exclude-if-present .git work?

ThomasWaldmann avatar Jan 19 '20 22:01 ThomasWaldmann

I believe it does, but my intention/example was underspecified. What I actually wanted to achieve was to exclude starting from a certain subdirectory, so borg create --keep-exclude-tags --exclude-if-present sh:/path/subdir/**/.git /path ...

erAck avatar Jan 30 '20 17:01 erAck