Skip to content
Snippets Groups Projects
Commit dc7f723e authored by intrigeri's avatar intrigeri
Browse files

Remove support for duplicity < 0.4.4. Even etch-backports has a newer one.

parent 55d9452d
Branches
Tags
No related merge requests found
...@@ -6,6 +6,8 @@ version 0.9.9 -- UNRELEASED ...@@ -6,6 +6,8 @@ version 0.9.9 -- UNRELEASED
dup: dup:
. Use --tempdir option rather than TMPDIR environment variable. . Use --tempdir option rather than TMPDIR environment variable.
(Closes Roundup bug #598) (Closes Roundup bug #598)
. Remove support for duplicity < 0.4.4. Even etch-backports has
a newer one.
postgresql: postgresql:
. Support various pg_dump formats in addition to pg_dumpall. . Support various pg_dump formats in addition to pg_dumpall.
Thanks to Jacob Anawalt <jlanawalt@gmail.com> for the patch. Thanks to Jacob Anawalt <jlanawalt@gmail.com> for the patch.
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
# vim: set filetype=sh sw=3 sts=3 expandtab autoindent: # vim: set filetype=sh sw=3 sts=3 expandtab autoindent:
# #
# duplicity script for backupninja # duplicity script for backupninja
# requires duplicity # requires duplicity >= 0.4.4
# #
getconf options getconf options
...@@ -106,35 +106,14 @@ duplicity_major="`echo $duplicity_version | @AWK@ -F '.' '{print $1}'`" ...@@ -106,35 +106,14 @@ duplicity_major="`echo $duplicity_version | @AWK@ -F '.' '{print $1}'`"
duplicity_minor="`echo $duplicity_version | @AWK@ -F '.' '{print $2}'`" duplicity_minor="`echo $duplicity_version | @AWK@ -F '.' '{print $2}'`"
duplicity_sub="`echo $duplicity_version | @AWK@ -F '.' '{print $3}'`" duplicity_sub="`echo $duplicity_version | @AWK@ -F '.' '{print $3}'`"
### ssh/scp/sftp options ### ssh/scp/sftp options (duplicity < 0.4.3 is unsupported)
# 1. duplicity >= 0.4.2 needs --sftp-command
# (NB: sftp does not support the -l option)
# 2. duplicity 0.4.3 to 0.4.9 replace --ssh-command with --ssh-options, which is
# passed to scp and sftp commands by duplicity. We don't use it: since this
# version does not use the ssh command anymore, we keep compatibility with
# our previous config files by passing $sshoptions to --scp-command and
# --sftp-command ourselves
scpoptions="$sshoptions" scpoptions="$sshoptions"
if [ "$bandwidthlimit" != 0 ]; then if [ "$bandwidthlimit" != 0 ]; then
[ -z "$desturl" ] || warning 'The bandwidthlimit option is not used when desturl is set.' [ -z "$desturl" ] || warning 'The bandwidthlimit option is not used when desturl is set.'
scpoptions="$scpoptions -l $bandwidthlimit" scpoptions="$scpoptions -l $bandwidthlimit"
fi fi
# < 0.4.2 : only uses ssh and scp
if [ "$duplicity_major" -le 0 -a "$duplicity_minor" -le 4 -a "$duplicity_sub" -lt 2 ]; then
execstr_options="${execstr_options} --scp-command 'scp $scpoptions' --ssh-command 'ssh $sshoptions'"
# >= 0.4.2 : also uses sftp, --sftp-command option is now supported
else
sftpoptions="$sshoptions" sftpoptions="$sshoptions"
# == 0.4.2 : uses ssh, scp and sftp
if [ "$duplicity_major" -eq 0 -a "$duplicity_minor" -eq 4 -a "$duplicity_sub" -eq 2 ]; then
execstr_options="${execstr_options} --scp-command 'scp $scpoptions' --sftp-command 'sftp $sftpoptions' --ssh-command 'ssh $sshoptions'"
# >= 0.4.3 : uses only scp and sftp, --ssh-command option is not supported anymore
else
execstr_options="${execstr_options} --scp-command 'scp $scpoptions' --sftp-command 'sftp $sftpoptions'" execstr_options="${execstr_options} --scp-command 'scp $scpoptions' --sftp-command 'sftp $sftpoptions'"
fi
fi
### Symmetric or asymmetric (public/private key pair) encryption ### Symmetric or asymmetric (public/private key pair) encryption
if [ -n "$encryptkey" ]; then if [ -n "$encryptkey" ]; then
...@@ -162,12 +141,7 @@ fi ...@@ -162,12 +141,7 @@ fi
# full backup. # full backup.
# If incremental==no, force a full backup anyway. # If incremental==no, force a full backup anyway.
if [ "$incremental" == "no" ]; then if [ "$incremental" == "no" ]; then
# before 0.4.4, full was an option and not a command
if [ "$duplicity_major" -le 0 -a "$duplicity_minor" -le 4 -a "$duplicity_sub" -lt 4 ]; then
execstr_options="${execstr_options} --full"
else
execstr_command="full" execstr_command="full"
fi
else else
# we're in incremental mode # we're in incremental mode
if [ "$increments" != "keep" ]; then if [ "$increments" != "keep" ]; then
...@@ -210,10 +184,6 @@ if [ "$keep" != "yes" ]; then ...@@ -210,10 +184,6 @@ if [ "$keep" != "yes" ]; then
if [ "`echo $keep | tr -d 0-9`" == "" ]; then if [ "`echo $keep | tr -d 0-9`" == "" ]; then
keep="${keep}D" keep="${keep}D"
fi fi
# before 0.4.4, remove-older-than was an option and not a command
if [ "$duplicity_major" -le 0 -a "$duplicity_minor" -le 4 -a "$duplicity_sub" -lt 4 ]; then
execstr_options="${execstr_options} --remove-older-than $keep"
fi
fi fi
### Source ### Source
...@@ -268,7 +238,6 @@ fi ...@@ -268,7 +238,6 @@ fi
### Cleanup commands (duplicity >= 0.4.4) ### Cleanup commands (duplicity >= 0.4.4)
# cleanup # cleanup
if [ "$duplicity_major" -ge 0 -a "$duplicity_minor" -ge 4 -a "$duplicity_sub" -ge 4 ]; then
debug "duplicity cleanup --force $execstr_options $execstr_serverpart" debug "duplicity cleanup --force $execstr_options $execstr_serverpart"
if [ ! $test ]; then if [ ! $test ]; then
export PASSPHRASE=$password export PASSPHRASE=$password
...@@ -285,11 +254,9 @@ if [ "$duplicity_major" -ge 0 -a "$duplicity_minor" -ge 4 -a "$duplicity_sub" -g ...@@ -285,11 +254,9 @@ if [ "$duplicity_major" -ge 0 -a "$duplicity_minor" -ge 4 -a "$duplicity_sub" -g
warning "Duplicity cleanup failed." warning "Duplicity cleanup failed."
fi fi
fi fi
fi
# remove-older-than # remove-older-than
if [ "$keep" != "yes" ]; then if [ "$keep" != "yes" ]; then
if [ "$duplicity_major" -ge 0 -a "$duplicity_minor" -ge 4 -a "$duplicity_sub" -ge 4 ]; then
debug "duplicity remove-older-than $keep --force $execstr_options $execstr_serverpart" debug "duplicity remove-older-than $keep --force $execstr_options $execstr_serverpart"
if [ ! $test ]; then if [ ! $test ]; then
export PASSPHRASE=$password export PASSPHRASE=$password
...@@ -307,7 +274,6 @@ if [ "$keep" != "yes" ]; then ...@@ -307,7 +274,6 @@ if [ "$keep" != "yes" ]; then
fi fi
fi fi
fi fi
fi
### Backup command ### Backup command
debug "duplicity $execstr_command $execstr_options $execstr_source --exclude '**' / $execstr_serverpart" debug "duplicity $execstr_command $execstr_options $execstr_source --exclude '**' / $execstr_serverpart"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment