mirror of
https://0xacab.org/liberate/backupninja.git
synced 2024-11-12 13:52:50 +01:00
[borg] add 'prune' setting to allow disabling pruning
This commit is contained in:
parent
60601b2f4c
commit
830a00759f
@ -259,8 +259,14 @@ do_borg_con() {
|
||||
}
|
||||
|
||||
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
|
||||
REPLY=
|
||||
formBegin "$borg_title - pruning (how many backups to keep)"
|
||||
@ -278,6 +284,7 @@ do_borg_prune() {
|
||||
borg_keepmonthly=${tmp_array[3]}
|
||||
|
||||
set +o noglob
|
||||
fi
|
||||
|
||||
_prune_done="(DONE)"
|
||||
}
|
||||
@ -307,6 +314,7 @@ EOF
|
||||
cat >> $next_filename <<EOF
|
||||
|
||||
## for more info see : borg prune -h
|
||||
prune = $borg_prune
|
||||
keephourly = $borg_keephourly
|
||||
keepdaily = $borg_keepdaily
|
||||
keepweekly = $borg_keepweekly
|
||||
|
@ -22,6 +22,7 @@ getconf testconnect yes
|
||||
getconf nicelevel 0
|
||||
|
||||
setsection source
|
||||
getconf prune yes
|
||||
getconf keephourly 1
|
||||
getconf keepdaily 7
|
||||
getconf keepweekly 4
|
||||
@ -138,7 +139,7 @@ fi
|
||||
prunestr="borg prune --keep-hourly $keephourly --keep-daily $keepdaily --keep-weekly $keepweekly --keep-monthly $keepmonthly $execstr_repository"
|
||||
debug "$prunestr"
|
||||
|
||||
if [ $test = 0 ]; then
|
||||
if [ $test = 0 ] && [ "$prune" == "yes" ]; then
|
||||
output="`su -c "$prunestr" 2>&1`"
|
||||
if [ $? = 0 ]; then
|
||||
debug $output
|
||||
|
Loading…
Reference in New Issue
Block a user