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

[borg] build/debug prunestr only if prune = yes

parent 54cc8c6b
Branches
Tags
No related merge requests found
...@@ -151,10 +151,10 @@ fi ...@@ -151,10 +151,10 @@ fi
### REMOVE OLD BACKUPS ### ### REMOVE OLD BACKUPS ###
# borg prune # borg prune
if [ "$prune" == "yes" ]; then
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
...@@ -164,6 +164,7 @@ if [ $test = 0 ] && [ "$prune" == "yes" ]; then ...@@ -164,6 +164,7 @@ if [ $test = 0 ] && [ "$prune" == "yes" ]; then
warning "Failed removing old backups." warning "Failed removing old backups."
fi fi
fi fi
fi
unset BORG_PASSPHRASE unset BORG_PASSPHRASE
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment