aboutsummaryrefslogtreecommitdiff
path: root/handlers/dup.in
diff options
context:
space:
mode:
Diffstat (limited to 'handlers/dup.in')
-rw-r--r--handlers/dup.in27
1 files changed, 26 insertions, 1 deletions
diff --git a/handlers/dup.in b/handlers/dup.in
index e3475b8..b58d34d 100644
--- a/handlers/dup.in
+++ b/handlers/dup.in
@@ -26,6 +26,7 @@ setsection dest
getconf incremental yes
getconf increments 30
getconf keep 60
+getconf keepincroffulls all
getconf desturl
getconf awsaccesskeyid
getconf awssecretaccesskey
@@ -51,7 +52,7 @@ fi
### VServers
# If vservers are configured, check that the ones listed in $vsnames do exist.
-local usevserver=no
+usevserver=no
if [ $vservers_are_available = yes ]; then
if [ "$vsnames" = all ]; then
vsnames="$found_vservers"
@@ -275,6 +276,30 @@ if [ "$keep" != "yes" ]; then
fi
fi
+# remove-all-inc-of-but-n-full : remove increments of older full backups : only keep latest ones
+if [ "$keep" != "yes" ]; then
+ if [ "$keepincroffulls" != "all" ]; then
+ if [ "$duplicity_major" -ge 0 -a "$duplicity_minor" -ge 9 -a "$duplicity_sub" -ge 10 ]; then
+ debug "$precmd duplicity remove-all-inc-of-but-n-full $keepincroffulls --force $execstr_options $execstr_serverpart"
+ if [ ! $test ]; then
+ export PASSPHRASE=$password
+ export FTP_PASSWORD=$ftp_password
+ output=`nice -n $nicelevel \
+ su -c \
+ "$precmd duplicity remove-all-inc-of-but-n-full $keepincroffulls --force $execstr_options $execstr_serverpart 2>&1"`
+ exit_code=$?
+ if [ $exit_code -eq 0 ]; then
+ debug $output
+ info "Duplicity remove-all-inc-of-but-n-full finished successfully."
+ else
+ debug $output
+ warning "Duplicity remove-all-inc-of-but-n-full failed."
+ fi
+ fi
+ fi
+ fi
+fi
+
### Backup command
debug "duplicity $execstr_command $execstr_options $execstr_source --exclude '**' / $execstr_serverpart"
if [ ! $test ]; then