Skip to content

Extra borg arguments with white space raise an error #2164

@goebbe

Description

@goebbe

A Vorta user had a hard time when pattern matching a folder-name with white space: #2156 (reply in thread)
Since matching names that contain a single space is a common use case, I decided to open this issue.

I am able to reproduce the issues, using Vorta 0.10.1 with borg 1.4 on LinuxMint22 (based on Ubuntu 24.4)

The issue appears e.g. when trying to pattern match an item name (Folder/ File) that contains white space,
via Vortas "Extra borg arguments for borg create" found at Vorta>Schedule>Shell Commands>Extra arguments for borg create.

To reproduce, I created a folder named test folder, with a single space in the middle of the folder-name.
I used the following --pattern option matcher and tried to exclude the folder from my backup by passing:
--pattern=-home/User/test\ folder

This led to an error message: borg create:error: argument ARCHIVE: "folder": No archive specified.

This is the borg command from the Vorta log files:
/usr/bin/borg create --remote-path=/usr/local/bin/borg --list --progress --info --log-json --json --filter=AM -C lz4 --pattern=-home/User/test\ folder ssh://[email protected]:22/~/backup/vorta-repo-EB845::User-EliteBook-845-2024-12-06-110323 /home/User

Since this borg command in the log-files seems to be correct, I presumed, that his must be a borg issue and opened an issue on borg: borgbackup/borg#8578

However, it appears that the borg command (from the Vorta logs) actually work as expected, when copied and executed directly on the command line.

To summarize the issue:

The following syntax works for matching test folder with a white space, when using borg directly on the command line:

$ borg create  --pattern=-subdir/test\ folder  repo::space subdir
$ borg create  '--pattern=-subdir/test folder'  repo::space subdir
$ borg create  --pattern='-subdir/test folder'  repo::space subdir

However, when passing these valid options using Vorta (Extra borg arguments) an error is raised:

--pattern=-subdir/test\ folder
'--pattern=-subdir/test folder'
--pattern='-subdir/test folder'

The error messages differ slightly, depending on which of the three options are used with Vorta.
But while each of these option works on the command line, none of these options could be used successfully when passed/ applied via Vorta.

Extract from the Vorta log files when escaping the white space by \:

2024-12-06 11:03:23,454 - vorta.borg.jobs_manager - DEBUG - Start job on site: 5
2024-12-06 11:03:23,473 - vorta.borg.borg_job - INFO - Running command /usr/bin/borg create --remote-path=/usr/local/bin/borg --list --progress --info --log-json --json --filter=AM -C lz4 --pattern=-home/User/test\ folder  ssh://[email protected]:22/~/backup/vorta-repo-EB845::User-EliteBook-845-2024-12-06-110323 /home/User
2024-12-06 11:03:23,560 - vorta.borg.borg_job - WARNING - usage: borg create [-h] [--critical] [--error] [--warning] [--info] [--debug]
2024-12-06 11:03:23,560 - vorta.borg.borg_job - WARNING - [--debug-topic TOPIC] [-p] [--iec] [--log-json]
2024-12-06 11:03:23,560 - vorta.borg.borg_job - WARNING - [--lock-wait SECONDS] [--bypass-lock] [--show-version]
2024-12-06 11:03:23,560 - vorta.borg.borg_job - WARNING - [--show-rc] [--umask M] [--remote-path PATH]
2024-12-06 11:03:23,562 - vorta.borg.borg_job - WARNING - [--remote-ratelimit RATE] [--upload-ratelimit RATE]
2024-12-06 11:03:23,562 - vorta.borg.borg_job - WARNING - [--remote-buffer UPLOAD_BUFFER]
2024-12-06 11:03:23,562 - vorta.borg.borg_job - WARNING - [--upload-buffer UPLOAD_BUFFER] [--consider-part-files]
2024-12-06 11:03:23,562 - vorta.borg.borg_job - WARNING - [--debug-profile FILE] [--rsh RSH] [-n] [-s] [--list]
2024-12-06 11:03:23,562 - vorta.borg.borg_job - WARNING - [--filter STATUSCHARS] [--json] [--no-cache-sync]
2024-12-06 11:03:23,562 - vorta.borg.borg_job - WARNING - [--stdin-name NAME] [--stdin-user USER]
2024-12-06 11:03:23,562 - vorta.borg.borg_job - WARNING - [--stdin-group GROUP] [--stdin-mode M]
2024-12-06 11:03:23,562 - vorta.borg.borg_job - WARNING - [--content-from-command] [--paths-from-stdin]
2024-12-06 11:03:23,562 - vorta.borg.borg_job - WARNING - [--paths-from-command] [--paths-delimiter DELIM]
2024-12-06 11:03:23,562 - vorta.borg.borg_job - WARNING - [-e PATTERN] [--exclude-from EXCLUDEFILE]
2024-12-06 11:03:23,562 - vorta.borg.borg_job - WARNING - [--pattern PATTERN] [--patterns-from PATTERNFILE]
2024-12-06 11:03:23,562 - vorta.borg.borg_job - WARNING - [--exclude-caches] [--exclude-if-present NAME]
2024-12-06 11:03:23,562 - vorta.borg.borg_job - WARNING - [--keep-exclude-tags] [--exclude-nodump] [-x]
2024-12-06 11:03:23,562 - vorta.borg.borg_job - WARNING - [--numeric-owner] [--numeric-ids] [--noatime] [--atime]
2024-12-06 11:03:23,562 - vorta.borg.borg_job - WARNING - [--noctime] [--nobirthtime] [--nobsdflags] [--noflags]
2024-12-06 11:03:23,562 - vorta.borg.borg_job - WARNING - [--noacls] [--noxattrs] [--sparse] [--files-cache MODE]
2024-12-06 11:03:23,562 - vorta.borg.borg_job - WARNING - [--read-special] [--comment COMMENT]
2024-12-06 11:03:23,562 - vorta.borg.borg_job - WARNING - [--timestamp TIMESTAMP] [-c SECONDS]
2024-12-06 11:03:23,562 - vorta.borg.borg_job - WARNING - [--chunker-params PARAMS] [-C COMPRESSION]
2024-12-06 11:03:23,562 - vorta.borg.borg_job - WARNING - ARCHIVE [PATH ...]
2024-12-06 11:03:23,562 - vorta.borg.borg_job - WARNING - borg create: error: argument ARCHIVE: "folder": No archive specified
2024-12-06 11:03:23,690 - vorta.borg.jobs_manager - DEBUG - Finish job for site: 5

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions