[Borgbackup] Pattern relative paths with multiple recursion roots

David Gasaway dave at gasaway.org
Thu Sep 15 19:58:54 EDT 2022


Hi,

As someone who is preparing to upgrade from 1.1 to 1.2, I'm reviewing my
patterns and docs to make sure everything works with the new relative
behavior.  I'm looking for some clarification from the pattern matching
docs, i.e.,
https://borgbackup.readthedocs.io/en/stable/usage/help.html#borg-help-patterns.
It leads with

The path/filenames used as input for the pattern matching start from the
> currently active recursion root.
>

As someone who uses --patterns-from and multiple recursion roots in the
file (currently 1.1, preparing to upgrade to 1.2), the meaning of
"currently active recursion root" isn't clear.  At first, I thought it
meant that I might have to move the recursion roots around so that the
patterns are immediately after the recursion root to which they would
match.  As in, borg keeps track of the last recursion root when parsing the
file.  However, the example further down suggests otherwise.

borg create --patterns-from patternfile.lst repo::arch
> # note that excludes use fm: by default and patternfiles use sh: by
> default.
> # therefore, we need to specify fm: to have the same exact behavior.
> P fm
> R /home/bobby
> R /home/susan
>
> - home/bobby/junk
>

This example makes it clear that an exclusion pattern is not relative to
either recursion root.  The docs do explain this, I think.

If you give /absolute/ as root, the paths going into the matcher will look
> relative like absolute/…/file.ext, because file paths in Borg archives are
> always stored normalized and relative.
>

I find the "relative" description a little confusing, but the end result
seems clear, anyway.  It does seem like one could end up with naming
conflicts by trying to mix absolute and relative roots (or multiple
relative roots?), but I have no intention of doing that.  I think I've
cleared my mind on that point, but I'd like to know if I misunderstood
something here.

The above example also shows, though the pattern applies to the contents of
the first root, it is after the second root.  That leaves me wondering
about "currently active recursion root".  I'm going to take a guess that it
means the code has a top-level loop through the recursion roots and
"current" is wherever it is in the loop at the time it's checking a
particular path-to-pattern combination.  Have I got that (close to) right?

Thanks.

-- 
-:-:- David K. Gasaway
-:-:- Email: dave at gasaway.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.python.org/pipermail/borgbackup/attachments/20220915/fc929a30/attachment.html>


More information about the Borgbackup mailing list