X-Git-Url: https://git.stderr.nl/gitweb?p=matthijs%2Fupstream%2Fbackupninja.git;a=blobdiff_plain;f=handlers%2Frdiff;h=52637cd42ee2eb2b7c8ab5313762735d3a8c1bab;hp=5561435331d6c0dab76e2f66678d52cd00309585;hb=ffac2e56a562a38bd5e9b3cdc807a687c5cb1cf4;hpb=5cf34cae1d7a5e5a88a58560a0479e2504db0ba9 diff --git a/handlers/rdiff b/handlers/rdiff index 5561435..52637cd 100644 --- a/handlers/rdiff +++ b/handlers/rdiff @@ -152,27 +152,31 @@ esac ### REMOVE OLD BACKUPS ### -if [ "`echo $keep | tr -d 0-9`" == "" ]; then +if [ "$keep" != yes ]; then + + if [ "`echo $keep | tr -d 0-9`" == "" ]; then # add D if no other date unit is specified - keep="${keep}D" -fi + keep="${keep}D" + fi -removestr="$RDIFFBACKUP $options --force --remove-older-than $keep " -if [ "$desttype" == "remote" ]; then - removestr="${removestr}${destuser}@${desthost}::" -fi -removestr="${removestr}${destdir}/${label}"; + removestr="$RDIFFBACKUP $options --force --remove-older-than $keep " + if [ "$desttype" == "remote" ]; then + removestr="${removestr}${destuser}@${desthost}::" + fi + removestr="${removestr}${destdir}/${label}"; + + debug "$removestr" + if [ $test = 0 ]; then + output="`su -c "$removestr" 2>&1`" + if [ $? = 0 ]; then + debug $output + info "Removing backups older than $keep days succeeded." + else + warning $output + warning "Failed removing backups older than $keep." + fi + fi -debug "$removestr" -if [ $test = 0 ]; then - output="`su -c "$removestr" 2>&1`" - if [ $? = 0 ]; then - debug $output - info "Removing backups older than $keep days succeeded." - else - warning $output - warning "Failed removing backups older than $keep." - fi fi # Add cstream