Find a file by name across archives #541
Labels
No Label
bug
data loss
design finalized
good first issue
new feature area
question / support
security
waiting for response
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: borgmatic-collective/borgmatic#541
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
A common use case with borgmatic is as follows: The user accidentally deletes or overwrites a file and wants to extract the original from backup so they can continue working with it. This is feasible with Borg and borgmatic, but it's kind of a pain today. The process might go something like this:
borgmatic list --archive latest
.borgmatic list
.borgmatic list --archive 1234
,borgmatic list --archive 1235
, etc etc.borgmatic extract ...
.As you can see, this process is kind of tedious—and not what you want to be doing when you're frantically trying to get your file back. Furthermore, if you're trying to use Borg patterns to try to find your file with
--path
or--pattern
, that can further complicate the process if you're not super familiar with the pattern syntax.So what if that process was a little more streamlined? Something like this:
borgmatic list --find foo.txt
borgmatic extract ...
And since this is
borgmatic list
, you can combine--find
with parameters like--last 5
or--archive latest
or--glob-archives ...
to limit the search to the archives you're interested in searching.Other notes / implementation ideas
Proposed output:
Proposed implementation: When
borgmatic list --find
is used, ask Borg for a list of all matching archives viaborg list
. Parse that list and runborg list
again with each archive, passing in the--find
path to each invocation.Inspired by: https://gitlab.gnome.org/World/pika-backup/-/issues/232 and
restic-find
.Implemented in master!
Released in borgmatic 1.6.3!