aboutsummaryrefslogtreecommitdiff
path: root/handlers
diff options
context:
space:
mode:
authorElijah Saxon <elijah@riseup.net>2005-01-19 19:39:14 +0000
committerElijah Saxon <elijah@riseup.net>2005-01-19 19:39:14 +0000
commitb29b969b86d68d9fa0a70c6fd0b826cbb0ab49b2 (patch)
tree33f83328d6e20a95ebb4c502b4c1d4582c8ed9d8 /handlers
parentc11ba1a2e1f45c891054e5f58c1d320368bd8cdc (diff)
downloadbackupninja-b29b969b86d68d9fa0a70c6fd0b826cbb0ab49b2.tar.gz
backupninja-b29b969b86d68d9fa0a70c6fd0b826cbb0ab49b2.tar.bz2
added options, keep passed directly to rdiff-backup
Diffstat (limited to 'handlers')
-rw-r--r--handlers/rdiff44
1 files changed, 24 insertions, 20 deletions
diff --git a/handlers/rdiff b/handlers/rdiff
index 90ca2a3..730e660 100644
--- a/handlers/rdiff
+++ b/handlers/rdiff
@@ -3,11 +3,13 @@
# requires rdiff-backup
#
+getconf options
+
setsection source
getconf type; sourcetype=$type
getconf label
getconf user root; sourceuser=$user
-getconf keep
+getconf keep 60
getconf include
getconf exclude
@@ -55,30 +57,32 @@ execstr_clientpart="/"
## REMOVE OLD BACKUPS
-if [ "$keep" -gt "0" ]; then
- removestr="rdiff-backup --force --remove-older-than ${keep}D "
- if [ "$desttype" == "remote" ]; then
- removestr="${removestr}${destuser}@${desthost}::"
- fi
- removestr="${removestr}${destdir}/${label}";
-
- debug "su $sourceuser -c '$removestr'"
- if [ ! $test ]; then
- output=`su $sourceuser -c "$removestr" 2>&1`
- code=$?
- if [ "$code" == "0" ]; then
- debug $output
- info "Removing backups older than $keep days succeeded."
- else
- warning $output
- warning "Failed removing backups older than $keep."
- fi
+if [ "`echo $keep | tr -d 0-9`" == "" ]; then
+ keep="${keep}D"
+fi
+
+removestr="rdiff-backup --force --remove-older-than $keep "
+if [ "$desttype" == "remote" ]; then
+ removestr="${removestr}${destuser}@${desthost}::"
+fi
+removestr="${removestr}${destdir}/${label}";
+
+debug "su $sourceuser -c '$removestr'"
+if [ ! $test ]; then
+ output=`su $sourceuser -c "$removestr" 2>&1`
+ code=$?
+ if [ "$code" == "0" ]; then
+ debug $output
+ info "Removing backups older than $keep days succeeded."
+ else
+ warning $output
+ warning "Failed removing backups older than $keep."
fi
fi
## EXECUTE ##
-execstr="$RDIFFBACKUP --print-statistics "
+execstr="$RDIFFBACKUP $options --print-statistics "
# TODO: order the includes and excludes