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
dup:
. Use --tempdir option rather than TMPDIR environment variable.
(Closes Roundup bug #598)
. Remove support for duplicity < 0.4.4. Even etch-backports has
a newer one.
postgresql:
. Support various pg_dump formats in addition to pg_dumpall.
Thanks to Jacob Anawalt <jlanawalt@gmail.com> for the patch.
......
......@@ -2,7 +2,7 @@
# vim: set filetype=sh sw=3 sts=3 expandtab autoindent:
#
# duplicity script for backupninja
# requires duplicity
# requires duplicity >= 0.4.4
#
getconf options
......@@ -106,35 +106,14 @@ duplicity_major="`echo $duplicity_version | @AWK@ -F '.' '{print $1}'`"
duplicity_minor="`echo $duplicity_version | @AWK@ -F '.' '{print $2}'`"
duplicity_sub="`echo $duplicity_version | @AWK@ -F '.' '{print $3}'`"
### ssh/scp/sftp options
# 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
### ssh/scp/sftp options (duplicity < 0.4.3 is unsupported)
scpoptions="$sshoptions"
if [ "$bandwidthlimit" != 0 ]; then
[ -z "$desturl" ] || warning 'The bandwidthlimit option is not used when desturl is set.'
scpoptions="$scpoptions -l $bandwidthlimit"
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"
# == 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'"
fi
fi
### Symmetric or asymmetric (public/private key pair) encryption
if [ -n "$encryptkey" ]; then
......@@ -162,12 +141,7 @@ fi
# full backup.
# If incremental==no, force a full backup anyway.
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"
fi
else
# we're in incremental mode
if [ "$increments" != "keep" ]; then
......@@ -210,10 +184,6 @@ if [ "$keep" != "yes" ]; then
if [ "`echo $keep | tr -d 0-9`" == "" ]; then
keep="${keep}D"
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
### Source
......@@ -268,7 +238,6 @@ fi
### Cleanup commands (duplicity >= 0.4.4)
# 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"
if [ ! $test ]; then
export PASSPHRASE=$password
......@@ -285,11 +254,9 @@ if [ "$duplicity_major" -ge 0 -a "$duplicity_minor" -ge 4 -a "$duplicity_sub" -g
warning "Duplicity cleanup failed."
fi
fi
fi
# remove-older-than
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"
if [ ! $test ]; then
export PASSPHRASE=$password
......@@ -307,7 +274,6 @@ if [ "$keep" != "yes" ]; then
fi
fi
fi
fi
### Backup command
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