Bash-style include patterns for source_directories #637
Labels
No Label
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#637
Loading…
Reference in New Issue
No description provided.
Delete Branch "%!s(<nil>)"
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
We want to make sure no "bak" directories are included in the backup. Having convention for exclude_pattern exist, but if some users do not follow the naming convention, it will of course be backed up. This is what we want to avoid.
So instead, we try to narrow down exactly what to backup. Is it possible to describe folders with bash-expansion {..} or similar?
Lets say we want to backup
somedir/year/month/day/*
paths:And we want to make sure to exclude paths like:
source_directories could look like:
Or even better:
Is this possible?
I have tried using the
"patterns" with regex and + and - but find it having quite strang behavior.
Environment
borgmatic version: 1.5.24
Borg version: 1.2.0
Python version: 3.9.2
operating system and version: Debian 11
I don't believe what you're trying to do is currently possible with
source_directories
, as that only expands simple globs (*
) and tildes (~
). For anything more complex, you'll need to usepatterns
, which includes support for regexes, shell-style expressions, etc. Perhaps you can post what you've tried so far with patterns and describe how it's not working? I'd be happy to help debug.Closing this for now, but please feel free to follow up and/or reopen so we can continue discussing. Thanks!