Database names configurable with wildcards #951
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
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
borgmatic-collective/borgmatic#951
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'd like to do and why
I'd like to be able to configure database names with wildcards, e.g.
koha_*oderwp_%. The reason is I run a very large DB server and the backups took long (currently 10min, but still growing). I need to have different backup sets to avoid conflicts. Currently, I need to configure each single DB name in the borgmatic config. There are over 100 DBs.It would be straightforward to just configure their prefixes.
Other notes / implementation ideas
No response
Could you say a little more about this request? For instance, which database system are you using? How would you expect the wildcards to work? What would fill them in? What would each of
*and%indicate? Etc.Thanks!
I'm using
MariaDB. It's not important which placeholder character you are using,%(more SQL specific) or*(more commonly used). I use*here.wp_*as database name should match all databases beginning withwp_.*means an arbitrary number ob characters, in RegEx[0-9a-z_-]*.is much simpler than
if you have hundreds of DB names.
Additionally you could also implement postfix matching but I don't know if this is practically relevant. Then,
*_wpshould match all databases ending with_wp.Got it, thanks for the explanation! I can definitely see the utility of that. There is the existing support for a
alldatabases, so I could see the wildcard syntax you're proposing being the general case. For instance, maybeallcould be replaced with just*once wildcards are implemented.I happen to be working on #418 now, which means I'm currently in the guts of borgmatic's database name logic. So there might be a good opportunity to follow that work with this wildcard support.
Any news about this?
No news. PRs welcome though. 😄
A workaround for this is to set
psql_commandto this Python script:The database matching logic isn’t that complicated though, I might make a PR for this at some point (and use this e-mail as reminder)