Skip to content
Snippets Groups Projects
Commit fc0e0849 authored by Jérôme Charaoui's avatar Jérôme Charaoui
Browse files

[borg] add init option to allow skipping init command

In some cases it may be desirable to skip repository initialization, for
example when the repository is located at the root of a mount point.
parent 714c0307
Branches
Tags
No related merge requests found
......@@ -35,6 +35,12 @@
[source]
## default is to initialize the backup repository if absent
## set to no to skip this step
##
## Default:
# init = yes
## how many hours, days, weeks and months of data to keep
##
## for more info see : borg help prune
......
......@@ -23,6 +23,7 @@ getconf nicelevel 0
getconf bwlimit
setsection source
getconf init yes
getconf prune yes
getconf keephourly 1
getconf keepdaily 7
......@@ -82,10 +83,9 @@ fi
### INIT IF NEEDED ###
if [ "$init" == "yes" ]; then
initstr="borg init --encryption=$encryption $execstr_repository"
debug "$initstr"
if [ $test = 0 ]; then
output="`su -c "$initstr" 2>&1`"
if [ $? = 2 ]; then
......@@ -96,6 +96,7 @@ if [ $test = 0 ]; then
warning "Repository has been initialized"
fi
fi
fi
### EXECUTE ###
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment