diff --git a/examples/example.borg b/examples/example.borg index 244dbc8b44557dcc80f3b2115c80fe06730df6ec..8644cbcc6a0ce653df39e8e066194866cfd434a1 100644 --- a/examples/example.borg +++ b/examples/example.borg @@ -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 diff --git a/handlers/borg.in b/handlers/borg.in index 0e88390a795085c21feb496cd6ec6365a2bce9fb..698ba6d12c932c3e16d0529e1bad6093e962c033 100644 --- a/handlers/borg.in +++ b/handlers/borg.in @@ -23,6 +23,7 @@ getconf nicelevel 0 getconf bwlimit setsection source +getconf init yes getconf prune yes getconf keephourly 1 getconf keepdaily 7 @@ -82,18 +83,18 @@ fi ### INIT IF NEEDED ### -initstr="borg init --encryption=$encryption $execstr_repository" - -debug "$initstr" - -if [ $test = 0 ]; then - output="`su -c "$initstr" 2>&1`" - if [ $? = 2 ]; then - debug $output - info "Repository was already initialized" - else - warning $output - warning "Repository has been initialized" +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 + debug $output + info "Repository was already initialized" + else + warning $output + warning "Repository has been initialized" + fi fi fi