Skip to content
Snippets Groups Projects
Commit 731d15eb authored by Olivier Berger's avatar Olivier Berger
Browse files

Add support for generic options config value

Allow setting additional parameters at borg invocation time

Inspired from the duplicity handler's options variable

Quick fix for #11349
parent 183b8c30
No related branches found
No related tags found
1 merge request!67Quick fix for #11349 : Add support for generic options config value
......@@ -11,6 +11,13 @@
## destination host and user.
##
## passed directly to borg commands, e.g. to use a particular remote
## borg executable (here: 'borg12'), set this to:
## options = --remote-path=borg12
##
## Default:
# options =
## default is 0, but set to 19 if you want to lower the priority.
## an example setting would be:
## nicelevel = 19
......
......@@ -294,6 +294,13 @@ do_borg_finish() {
## - example.borg
## - $borg_docs
## passed directly to borg commands, e.g. to use a particular remote
## borg executable (here: 'borg12'), set this to:
## options = --remote-path=borg12
##
## Default:
# options =
[source]
EOF
## includes ##
......
......@@ -22,6 +22,7 @@ export BORG_UNKNOWN_UNENCRYPTED_REPO_ACCESS_IS_OK=yes
### GET CONFIG ###
getconf options
getconf testconnect yes
getconf nicelevel 0
getconf ionicelevel
......@@ -109,7 +110,7 @@ if [ "$host" != "localhost" ] && ([ "$testconnect" = "yes" ] || [ "${test}" -eq
if [ "$ret" = 1 ]; then
debug "Connected to $host as $user successfully"
else
teststr="borg list --show-rc -v $execstr_repository"
teststr="borg list $options --show-rc -v $execstr_repository"
debug "$teststr"
output=`su -c "$teststr" 2>&1`
if echo "$output" | grep "terminating with success status" \
......@@ -126,7 +127,7 @@ fi
### INIT IF NEEDED ###
if [ "$init" == "yes" ]; then
initstr="borg init --encryption=$encryption $execstr_repository"
initstr="borg init $options --encryption=$encryption $execstr_repository"
debug "executing borg init"
debug "$initstr"
if [ $test = 0 ]; then
......@@ -143,7 +144,7 @@ fi
### EXECUTE ###
execstr="borg create --stats --compression $compression"
execstr="borg create $options --stats --compression $compression"
set -o noglob
......@@ -207,7 +208,7 @@ if [ "$prune" == "yes" ]; then
if [ ! "$keep" == "0" ]; then
prune_options="${prune_options} --keep-within=${keep}"
fi
prunestr="borg prune $prune_options $execstr_repository"
prunestr="borg prune $options $prune_options $execstr_repository"
debug "executing borg prune"
debug "$prunestr"
if [ $test = 0 ]; then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment