aboutsummaryrefslogtreecommitdiff
path: root/handlers
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2007-06-19 09:55:13 +0000
committerintrigeri <intrigeri@boum.org>2007-06-19 09:55:13 +0000
commitffac2e56a562a38bd5e9b3cdc807a687c5cb1cf4 (patch)
tree0b6e5a0aed45c261c28058407ecc9c4baceb9e34 /handlers
parent5cf34cae1d7a5e5a88a58560a0479e2504db0ba9 (diff)
downloadbackupninja-ffac2e56a562a38bd5e9b3cdc807a687c5cb1cf4.tar.gz
backupninja-ffac2e56a562a38bd5e9b3cdc807a687c5cb1cf4.tar.bz2
rdiff: handle "keep = yes" to disable old backups removal (Closes: #424633)
Diffstat (limited to 'handlers')
-rw-r--r--handlers/rdiff40
1 files changed, 22 insertions, 18 deletions
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