[Borgbackup] Multi-archive searches in Borg Backup?

Marian Beermann public at enkore.de
Sat Sep 10 05:40:20 EDT 2016


Hi

On 10.09.2016 03:13, DS Jstc wrote:
> I'm evaluating several backup systems.  I really like what I'm reading
> about Borg, but the Usage document doesn't seem to have anything about
> multi-archive searches.  Here are the primary use-cases that concern me:
> 
> Case 1: I've deleted a file, but I'm not sure when.  I'd like to restore
> the last valid version of it, but obviously, I don't know which
> repository it's in.  Can I search for it?
>
> Case 2: I need a deleted file for which I don't know the full pathname. 
> I'd like to run a regex search against all paths in all archives in the
> repository.

This can be done with the current stable version (1.0) when you mount
the repository via FUSE. You can then use e.g. GNU find or your normal
file manager to search for files just as if they were on a normal disk.

> 
> Case 3: I made a critical error in an important document at some time in
> the past.  I need to see every archive in which a change was recorded so
> I can retrieve the last pre-error version.
> 
> Can Borg handle any of these use cases?

In 1.1 (currently in beta) there are several tools that make things like
this far easier (and also 1.) and 2.)):


- FUSE mounted repositories have a "versions view" where all versions of
a file are available:

/path/file.version.238123
/path/file.version.123902
/path/otherfile.version.231213
...


- borg-diff can easily print the difference between (subsets of)
archives. It's very fast and e.g. manual-binary-search is feasible.

$ time borg diff testrepo::linux1 linux2
+100.4 kB -100.5 kB linux-4.4.2/fs/btrfs/check-integrity.c
removed       279 B linux-4.4.2/drivers/gpu/Makefile
3.48user 0.04system 0:03.56elapsed 98%CPU


- borg-list supports the full range of patterns, including regular
expressions:

$ borg list testrepo::asdf "re:.*/PKG-INFO"
-rw-r--r-- mabe   mabe      10460 Sat, 2016-08-27 01:54:31
src/borgbackup.egg-info/PKG-INFO
$



Cheers, Marian



Current beta docs:

borg-diff: http://borgbackup.readthedocs.io/en/1.1.0b1/usage.html#borg-diff
borg-mount:
http://borgbackup.readthedocs.io/en/1.1.0b1/usage.html#borg-mount
borg-list: http://borgbackup.readthedocs.io/en/1.1.0b1/usage.html#borg-list

patterns:
http://borgbackup.readthedocs.io/en/1.1.0b1/usage.html#borg-help-patterns


More information about the Borgbackup mailing list