Exclusions not preventing recursion into directories #982
Labels
No labels
blocked
breaking
bug
data loss
design finalized
good first issue
new feature area
question / support
security
waiting for response
No milestone
No assignees
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
borgmatic-collective/borgmatic#982
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What I'm trying to do and why
I’m encountering an issue (or a misunderstanding) while trying to back up a folder in my home directory with some exclusions. My setup includes a directory that contains many subfolders and files, which I’ve added to my exclusions. However, it seems that Borgmatic is recursing into the directory, and the logs indicate that all files within are being tagged as excluded. I believe this is unnecessary, as the entire folder is meant to be excluded entirely.
This behavior is problematic because it results in unnecessary traversal of files and folders that I intend to exclude completely. I’d like to confirm whether this is expected behavior or a misconfiguration on my end.
Steps to reproduce
Here some testing configurations i made :
Actual behavior
Attached full log
Expected behavior
I don't want each file to be read; I want the parent folder to be excluded.
Other notes / implementation ideas
No response
borgmatic version
1.9.8
borgmatic installation method
pip install
Borg version
1.4.0
Python version
3.11.2
Database version (if applicable)
No response
Operating system and version
Debian 12
Exclusions not preventing eecursion into directoriesto Exclusions not preventing recursion into directoriesThanks for filing this. I believe this is actually a regression since borgmatic 1.9.6, but fortunately one that should be easy to fix. In borgmatic 1.9.6, exclude patterns were changed under the hood to be treated as generic Borg patterns. This unification makes it much easier for borgmatic to manipulate paths internally, which is needed for things like database and filesystem hooks.
However, apparently the change meant that exclude patterns started recursing into subdirectories as you're seeing—which is the usual behavior for generic Borg patterns because it allows the user to include subdirectories within excluded parent directories. A fix for this would be for borgmatic to treat configured excluded patterns as "no recurse" subdirectories, which is a supported pattern type with Borg. I'll look into implementing that now!
Yes everything works fine with 1.9.5, i'll wait for the fix before upgrade then. Thanks.
Okay, this is fixed in main and will be part of the next release. Thanks again for the report!
Released in borgmatic 1.9.9!