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

[borg] add 'prune' setting to allow disabling pruning

parent 60601b2f
Branches
No related tags found
No related merge requests found
...@@ -259,8 +259,14 @@ do_borg_con() { ...@@ -259,8 +259,14 @@ do_borg_con() {
} }
do_borg_prune() { do_borg_prune() {
declare -a tmp_array radioBox "$borg_title" "pruning (how many backups to keep" \
"yes" "regularly prune old backups" on \
"no" "keep all backups" off
[ $? = 1 ] && return;
borg_prune="$REPLY"
if [ "$borg_prune" = "yes" ]; then
declare -a tmp_array
set -o noglob set -o noglob
REPLY= REPLY=
formBegin "$borg_title - pruning (how many backups to keep)" formBegin "$borg_title - pruning (how many backups to keep)"
...@@ -278,6 +284,7 @@ do_borg_prune() { ...@@ -278,6 +284,7 @@ do_borg_prune() {
borg_keepmonthly=${tmp_array[3]} borg_keepmonthly=${tmp_array[3]}
set +o noglob set +o noglob
fi
_prune_done="(DONE)" _prune_done="(DONE)"
} }
...@@ -307,6 +314,7 @@ EOF ...@@ -307,6 +314,7 @@ EOF
cat >> $next_filename <<EOF cat >> $next_filename <<EOF
## for more info see : borg prune -h ## for more info see : borg prune -h
prune = $borg_prune
keephourly = $borg_keephourly keephourly = $borg_keephourly
keepdaily = $borg_keepdaily keepdaily = $borg_keepdaily
keepweekly = $borg_keepweekly keepweekly = $borg_keepweekly
......
...@@ -22,6 +22,7 @@ getconf testconnect yes ...@@ -22,6 +22,7 @@ getconf testconnect yes
getconf nicelevel 0 getconf nicelevel 0
setsection source setsection source
getconf prune yes
getconf keephourly 1 getconf keephourly 1
getconf keepdaily 7 getconf keepdaily 7
getconf keepweekly 4 getconf keepweekly 4
...@@ -138,7 +139,7 @@ fi ...@@ -138,7 +139,7 @@ fi
prunestr="borg prune --keep-hourly $keephourly --keep-daily $keepdaily --keep-weekly $keepweekly --keep-monthly $keepmonthly $execstr_repository" prunestr="borg prune --keep-hourly $keephourly --keep-daily $keepdaily --keep-weekly $keepweekly --keep-monthly $keepmonthly $execstr_repository"
debug "$prunestr" debug "$prunestr"
if [ $test = 0 ]; then if [ $test = 0 ] && [ "$prune" == "yes" ]; then
output="`su -c "$prunestr" 2>&1`" output="`su -c "$prunestr" 2>&1`"
if [ $? = 0 ]; then if [ $? = 0 ]; then
debug $output debug $output
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment