Need help with exclude_patterns #453
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#453
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
I want to set up a filter to exclude some files, like WhatsApp DBs that have dates in the filename, like
msgstore-2021-09-15.1.db.crypt14.
The filter I've come up with is
msgstore-20*.*
which works if I search for files in WinSCP, but does not work in borgmatic/borg because these files are still included in my backups.I don't want to exclude all crypt14 files because I want to backup another WhatsApp DB which has the same extension but different file name.
I'm sure I am making a very dumb mistake because a simple filter works, like if I exclude a full path (e.g. a temp folder).
I think this issue also applies to the other files I'm trying to exclude when using asterisks.
Steps to reproduce (if a bug)
Here's the relevant configuration. The first two folder patterns work, the others not really.
Actual behavior (if a bug)
Expected behavior (if a bug)
Other notes / implementation ideas
I'm not sure what I'm doing wrong, but there are no very good examples to do this kind of exclusions, neither in Borgbackup docs.
Environment
borgmatic version: 1.5.12
borgmatic installation method: Debian Package
Borg version: 1.1.15
Python version: Python 3.7.3
Database version (if applicable): N/A
operating system and version: Debian 10 (OpenMediaVault 5.x)
Thanks for taking the time to file this! (Sorry nobody got to your question on IRC.) Looking at the Borg docs on exclude patterns, there's one sentence in particular that stands out to me as potentially relevant: "For a path to match a pattern, the full path must match, or it must match from the start of the full path to just before a path separator." I think what this means is that if your pattern is an absolute path or starts with a glob, then it'll match a full path properly. On the other hand, if your pattern does not begin with an absolute path and does not start with a glob, then it can't match a full path. If that's the case, then,
msgstore-20*.*
wouldn't match anything.So how to fix this? Couple of options:
*/msgstore-20*.*
sh:**/msgstore-20*.*
(untested)re:^.*/msgstore-20.*\..*$
(untested)Give something along those lines a shot and let me know how they work for you!
Thanks for letting me know but I would have never seen a reply: I signed in as guest and when I refreshed the page my m messages were cleared...
Thanks for the patterns! I will try the first one. On saturday my backup will run and I'll be able to report back. I will also change all the others accordingly.
I'm happy to confirm that
*/msgstore-20*.*
made the trick! Thank a lot!Awesome, so glad to hear it! I've updated the examples in the configuration file to include a pattern like this one.