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
No related branches found
No related tags found
No related merge requests found
...@@ -35,6 +35,12 @@ ...@@ -35,6 +35,12 @@
[source] [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 ## how many hours, days, weeks and months of data to keep
## ##
## for more info see : borg help prune ## for more info see : borg help prune
......
...@@ -23,6 +23,7 @@ getconf nicelevel 0 ...@@ -23,6 +23,7 @@ getconf nicelevel 0
getconf bwlimit getconf bwlimit
setsection source setsection source
getconf init yes
getconf prune yes getconf prune yes
getconf keephourly 1 getconf keephourly 1
getconf keepdaily 7 getconf keepdaily 7
...@@ -82,10 +83,9 @@ fi ...@@ -82,10 +83,9 @@ fi
### INIT IF NEEDED ### ### INIT IF NEEDED ###
if [ "$init" == "yes" ]; then
initstr="borg init --encryption=$encryption $execstr_repository" initstr="borg init --encryption=$encryption $execstr_repository"
debug "$initstr" debug "$initstr"
if [ $test = 0 ]; then if [ $test = 0 ]; then
output="`su -c "$initstr" 2>&1`" output="`su -c "$initstr" 2>&1`"
if [ $? = 2 ]; then if [ $? = 2 ]; then
...@@ -96,6 +96,7 @@ if [ $test = 0 ]; then ...@@ -96,6 +96,7 @@ if [ $test = 0 ]; then
warning "Repository has been initialized" warning "Repository has been initialized"
fi fi
fi fi
fi
### EXECUTE ### ### EXECUTE ###
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment