diff options
author | intrigeri <intrigeri@boum.org> | 2012-01-29 14:39:10 +0100 |
---|---|---|
committer | intrigeri <intrigeri@boum.org> | 2012-01-29 15:09:37 +0100 |
commit | f896ef3f6525cfedd345aae23e6fd8274d90dc24 (patch) | |
tree | 8741d73035e0dd0af9d351d4b35f9eaa6945edb3 /handlers/dup.in | |
parent | 357a17b155f769f0bf290f3a11e2d84aa4350a60 (diff) | |
download | backupninja-f896ef3f6525cfedd345aae23e6fd8274d90dc24.tar.gz backupninja-f896ef3f6525cfedd345aae23e6fd8274d90dc24.tar.bz2 |
dup: add precmd to every duplicity call.
Diffstat (limited to 'handlers/dup.in')
-rw-r--r-- | handlers/dup.in | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/handlers/dup.in b/handlers/dup.in index b358406..6fbb27a 100644 --- a/handlers/dup.in +++ b/handlers/dup.in @@ -95,6 +95,7 @@ fi ### COMMAND-LINE MANGLING ###################################################### ### initialize $execstr* +execstr_precmd= execstr_command= execstr_options="$options --no-print-statistics" execstr_source= @@ -261,13 +262,13 @@ fi ### Cleanup commands (duplicity >= 0.4.4) # cleanup -debug "duplicity cleanup --force $execstr_options $execstr_serverpart" +debug "$execstr_precmd duplicity cleanup --force $execstr_options $execstr_serverpart" if [ ! $test ]; then export PASSPHRASE=$password export FTP_PASSWORD=$ftp_password output=`nice -n $nicelevel \ su -c \ - "duplicity cleanup --force $execstr_options $execstr_serverpart 2>&1"` + "$execstr_precmd duplicity cleanup --force $execstr_options $execstr_serverpart 2>&1"` exit_code=$? if [ $exit_code -eq 0 ]; then debug $output @@ -280,13 +281,13 @@ fi # remove-older-than if [ "$keep" != "yes" ]; then - debug "duplicity remove-older-than $keep --force $execstr_options $execstr_serverpart" + debug "$execstr_precmd duplicity remove-older-than $keep --force $execstr_options $execstr_serverpart" if [ ! $test ]; then export PASSPHRASE=$password export FTP_PASSWORD=$ftp_password output=`nice -n $nicelevel \ su -c \ - "duplicity remove-older-than $keep --force $execstr_options $execstr_serverpart 2>&1"` + "$execstr_precmd duplicity remove-older-than $keep --force $execstr_options $execstr_serverpart 2>&1"` exit_code=$? if [ $exit_code -eq 0 ]; then debug $output @@ -302,13 +303,13 @@ fi if [ "$keep" != "yes" ]; then if [ "$keepincroffulls" != "all" ]; then if [ "$duplicity_major" -ge 0 -a "$duplicity_minor" -ge 6 -a "$duplicity_sub" -ge 10 ]; then - debug "$precmd duplicity remove-all-inc-of-but-n-full $keepincroffulls --force $execstr_options $execstr_serverpart" + debug "$execstr_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"` + "$execstr_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 @@ -323,14 +324,14 @@ if [ "$keep" != "yes" ]; then fi ### Backup command -debug "duplicity $execstr_command $execstr_options $execstr_source --exclude '**' / $execstr_serverpart" +debug "$execstr_precmd duplicity $execstr_command $execstr_options $execstr_source --exclude '**' / $execstr_serverpart" if [ ! $test ]; then outputfile=`maketemp backupout` export PASSPHRASE=$password export FTP_PASSWORD=$ftp_password output=`nice -n $nicelevel \ su -c \ - "duplicity $execstr_command $execstr_options $execstr_source --exclude '**' / $execstr_serverpart >$outputfile 2>&1"` + "$execstr_precmd duplicity $execstr_command $execstr_options $execstr_source --exclude '**' / $execstr_serverpart >$outputfile 2>&1"` exit_code=$? debug $output cat $outputfile | (while read output ; do |