[Borgbackup] borg create is not accepting PATH with SPACE in it

Amar amar at mailbox.org
Mon Mar 16 11:11:39 EDT 2020


Thank you, Marian.

I guess I will try to learn how shell is coming in the picture here. I didn’t mean to say it was borg’s problem. Maybe I should not have phrased it as “borg create is not accepting..”.

Sending path with space in it inside single quotes ‘/home/user/folder name’ and passing it directly in "borg create” command after REPO::ARCHIVE works fine (not if I use it in a ). Multiple paths worked too - so I guess I should be able to get it from a file that outputs a lis of paths as in ‘path 1’ ‘path 2’ after ARCHIVE (So if nothing works I will just do this or changed my folder name)

Bu is there a way where I can list “excludes” in a file and “includes” in another file (something like this https://restic.readthedocs.io/en/latest/040_backup.html#including-files <https://restic.readthedocs.io/en/latest/040_backup.html#including-files>; just an example)?

I also think (I maybe wrong; couldn’t find detailed documentation about this) that if I use "--patterns-from" I will have to give a root directory in PATH (after ARCHIVE) and then in patterns I will have to exclude everything I don’t want to backup and include everything I want to backup (? I am not clear on this).

Right now I am getting  "--patterns-from: command not found” and also “borg: error: Need at least one PATH argument.”

Is there a comprehensive documentation with detailed examples? Or a tutorial that uses borg to backup multiple directories listed in a file? What combination of options can be used together? Which ones not? If I use patterns-from do I still have to supply a PATH, or the paths listed by +/- alone takes care of it? What’s R in the beginning of the pattern file?

Regards.

> On 16 Mar 20, at 12:59 PM, Marian Beermann <public at enkore.de> wrote:
> 
> Hi,
> 
> you will have to understand shell. This is not a Borg problem; it's a
> shell problem.
> 
>> Even if I try to pass a single path (instead of a *cat* command) after
>> REPO::ARCHIVE with space in it it fails.
> 
> In this case you will need quotes or escaping, e.g.
> 
> borg create ... "$HOME/My Documents"
> (~ is not expanded by shells inside quotes, but variables are)
> 
> borg create ... '/home/amar/My Documents'
> (No variables are expanded by shells inside single quotes)
> 
> borg create ... /home/amar/My\ Documents
> 
> Either of these three pass the same path to borg.
> 
> Now for the file problem.
> 
> The tl;dr is you don't want to do this yourself and this is the exact
> reason Borg has --pattern-from and other applications things like @file
> to read args from a file.
> 
> Without extra processing there is no way to pass the contents of a file
> as multiple command arguments if you need escaping.
> 
> However, there is a standard utility that can be made to do this for
> you. It's not really meant for this particular use case, but it'll work.
> 
> xargs borg create ... < $BORG_INCLUDE_FILE
> 
> The format of BORG_INCLUDE_FILE has to look like this:
> 
> '/home/amar/My Documents'
> '/home/amar/My Pictures'
> etc.
> 
> (If you add too many files to the list, xargs will start to run multiple
> borg processes, which will cause errors or multiple archives containing
> subsets)
> 
> -Marian


Amar

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/borgbackup/attachments/20200316/27b1ba17/attachment.html>


More information about the Borgbackup mailing list