[Borgbackup] borg create: it's really difficult to get wildcard expansions correct

Billy Charlton billy at worldofbilly.com
Wed Dec 23 17:44:45 EST 2015


Aha -- so ".*" is excluding "." because * matches zero or more characters.
I probably knew that at some point.

So, ".?*" should do the trick -- and now after testing, it does. Thank you!
..b


On Wed, Dec 23, 2015 at 2:39 PM, Dan Christensen <jdc at uwo.ca> wrote:

> On Dec 23, 2015, Billy Charlton <billy at worldofbilly.com> wrote:
>
> ...
>
> > Here's what I want to do:
> > - I want to back up everything in my home directory, except for my
> > dotfiles, dot folders, and one folder called "AppData".
>
> ...
>
> > So, I feel like this command should work:
> >
> > cd ~
> > borg create -v --exclude "./AppData" --exclude ".*" test::mybackup .
> >
> > but that second exclude is apparently excluding ALL files. Why is that?
> > Shouldn't it just exclude files and folders that begin with "."?
>
> I believe that pattern is matching the root directory of your backup,
> so everything is getting excluded.
>
> Using
>
>   --exclude ".[a-zA-Z0-9]*"
>
> seems to do the trick, assuming all of the files/dirs you need to
> exclude have a letter or number as the second character.  Actually,
> this
>
>   --exclude ".?*"
>
> is probably better, as it allows any second character.
>
> Incidentally, attic has paths of the form "./path/to/file" in this
> situation, so this is an incompatibility with attic that should be
> documented (if it isn't already).
>
> Dan
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/borgbackup/attachments/20151223/81d536b5/attachment.html>


More information about the Borgbackup mailing list