When a exclude-norecurse pattern ends with a trailing slash, Borg still recurses one level below the excluded path
- Dominant language
- Python
- Stars
- 13.7k
- Forks
- 875
- Avg merge
- 11h 15m
- Merged PRs (30d)
- 192
Description
## Have you checked borgbackup docs, FAQ, and open Github issues?
Yes. #3209 might be related.
## Is this a BUG / ISSUE report or a QUESTION?
ISSUE
## System information. For client/server mode post info for both machines.
#### Your borg version (borg -V).
1.2.2
#### Operating system (distribution) and version.
Arch Linux
#### Hardware / network configuration, and filesystems used.
n.a.
#### How much data is handled by borg?
n.a.
#### Full borg commandline that lead to the problem (leave away excludes and passwords)
see below
## Describe the problem you're observing.
When a exclude-norecurse pattern ends with a trailing slash, Borg still recurses one level below the excluded path. The exclude still works correct, but Borg should skip recursion.
~~~sh
# normal exclude works as expected
(venv) c0d3@z3r0:[~]# rm -rf repo; borg init -e none repo; venv/bin/borg -p create --pattern '- re:^test/' --list repo:: /test
x /test/Downloadx 0 N test
x /test/Downloadx/owh
x /test/blub
d /test
# without trailing slash: works as expected
(venv) c0d3@z3r0:[~]# rm -rf repo; borg init -e none repo; venv/bin/borg -p create --pattern '! re:^test' --list repo::test /test
x /test
# trailing slash, regex: Borg recurses (exclude still working correct, though)
(venv) c0d3@z3r0:[~]# rm -rf repo; borg init -e none repo; venv/bin/borg -p create --pattern '! re:^test/' --list repo::test /test
x /test/Downloadx 0 N test
x /test/blub
d /test
# same for sh:, just for comparison
(venv) c0d3@z3r0:[~]# rm -rf repo; borg init -e none repo; venv/bin/borg -p create --pattern '! sh:test' --list repo::test /test
x /test
(venv) c0d3@z3r0:[~]# rm -rf repo; borg init -e none repo; venv/bin/borg -p create --pattern '! sh:test/' --list repo::test /test
x /test/Downloadx 0 N test
x /test/blub
d /test
~~~
Contributor guide
Assessment
This issue has not been assessed yet.