Skip to content
Snippets Groups Projects
Commit 1faaab09 authored by Emil Breiner's avatar Emil Breiner
Browse files

Make it possible to add custom init_options in borgbackup


Grants the possibility to initialize repositories with custom init_options like '--append-only'.

Change-Id: Icde51728102c9800de1bc166ef8d51ed71793b89
Signed-Off-By: default avatarEmil Breiner <emil.breiner@krumedia.com>
parent ab8d5a3a
Branches
Tags
No related merge requests found
......@@ -284,6 +284,13 @@ do_borg_prune() {
fi
_prune_done="(DONE)"
setDefault init
}
do_borg_init_options() {
inputBox "$borg_title" "Specify custom options for the repository initialization:"
[ $? -eq 1 ] && return
borg_init_options=$REPLY
setDefault finish
}
......@@ -314,6 +321,7 @@ EOF
## for more info see : borg prune -h
prune = $borg_prune
keep = "${borg_keep}d"
init_options = $borg_init_options
[dest]
directory = $borg_directory
......@@ -336,12 +344,14 @@ borg_main_menu() {
conitem="test connection and destination dir $_con_done"
encitem="configure encryption mode $_enc_done"
pruneitem="configure pruning (optional) $_prune_done"
inititem="add custom repository'init_options' (optional) $_init_options_done"
menuBox "$borg_title" "choose a step:" \
src "$srcitem" \
dest "$destitem" \
conn "$conitem" \
enc "$encitem" \
prune "$pruneitem" \
init "$inititem" \
finish "finish and create config file"
[ $? = 0 ] || return
result="$REPLY"
......@@ -351,6 +361,7 @@ borg_main_menu() {
"conn") do_borg_con;;
"enc") do_borg_enc;;
"prune") do_borg_prune;;
"init") do_borg_init_options;;
"finish")
if [[ "$_con_done$_dest_done$_enc_done$_src_done" != "(DONE)(DONE)(DONE)(DONE)" ]]; then
msgBox "$borg_title" "You cannot create the configuration file until mandatory steps are completed."
......@@ -382,6 +393,7 @@ borg_wizard() {
borg_encryption=none
borg_passphrase=
borg_keep=30
borg_init_options=
# Global variables whose '*' shall not be expanded
set -o noglob
......
......@@ -32,6 +32,7 @@ getconf prune yes
getconf keep 30d
getconf prune_options
getconf cache_directory
getconf init_options
setsection dest
getconf user
......@@ -98,7 +99,7 @@ fi
### INIT IF NEEDED ###
if [ "$init" == "yes" ]; then
initstr="borg init --encryption=$encryption $execstr_repository"
initstr="borg init --encryption=$encryption $init_options $execstr_repository"
debug "$initstr"
if [ $test = 0 ]; then
output="`su -c "$initstr" 2>&1`"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment