mirror of
https://0xacab.org/liberate/backupninja.git
synced 2024-11-23 03:02:32 +01:00
[borg] build/debug prunestr only if prune = yes
This commit is contained in:
parent
54cc8c6b32
commit
6a3a8321f0
@ -151,17 +151,18 @@ fi
|
||||
### REMOVE OLD BACKUPS ###
|
||||
|
||||
# borg prune
|
||||
prunestr="borg prune --keep-hourly $keephourly --keep-daily $keepdaily --keep-weekly $keepweekly --keep-monthly $keepmonthly $execstr_repository"
|
||||
debug "$prunestr"
|
||||
|
||||
if [ $test = 0 ] && [ "$prune" == "yes" ]; then
|
||||
output="`su -c "$prunestr" 2>&1`"
|
||||
if [ $? = 0 ]; then
|
||||
debug $output
|
||||
info "Removing old backups succeeded."
|
||||
else
|
||||
warning $output
|
||||
warning "Failed removing old backups."
|
||||
if [ "$prune" == "yes" ]; then
|
||||
prunestr="borg prune --keep-hourly $keephourly --keep-daily $keepdaily --keep-weekly $keepweekly --keep-monthly $keepmonthly $execstr_repository"
|
||||
debug "$prunestr"
|
||||
if [ $test = 0 ]; then
|
||||
output="`su -c "$prunestr" 2>&1`"
|
||||
if [ $? = 0 ]; then
|
||||
debug $output
|
||||
info "Removing old backups succeeded."
|
||||
else
|
||||
warning $output
|
||||
warning "Failed removing old backups."
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user