diff options
author | Micah Anderson <micah@riseup.net> | 2005-05-24 19:27:43 +0000 |
---|---|---|
committer | Micah Anderson <micah@riseup.net> | 2005-05-24 19:27:43 +0000 |
commit | 1e410a6d9574c56b7d3a3633b82220eacf782d06 (patch) | |
tree | fd66e45778a58f6823e86d5ad1e1dfab8e2dad92 /handlers/rdiff | |
parent | 4f36863c09ad4e3c2613531873292e0e5c1250a2 (diff) | |
download | backupninja-1e410a6d9574c56b7d3a3633b82220eacf782d06.tar.gz backupninja-1e410a6d9574c56b7d3a3633b82220eacf782d06.tar.bz2 |
Updates to handle vservers
Diffstat (limited to 'handlers/rdiff')
-rw-r--r-- | handlers/rdiff | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/handlers/rdiff b/handlers/rdiff index 61eb7f5..ca97fa4 100644 --- a/handlers/rdiff +++ b/handlers/rdiff @@ -12,6 +12,7 @@ getconf type; sourcetype=$type getconf label getconf keep 60 getconf include +getconf vsinclude getconf exclude ### DESTINATION ### @@ -24,6 +25,18 @@ getconf type; desttype=$type getconf user; destuser=$user getconf host; desthost=$host +# See if vservers are configured +if [ "$VSERVERS" = "yes" ] +then + if [ ! -d $VROOTDIR ] + then + fatal "vservers enabled, but $VROOTDIR does not exist!" + else + info "vserver method enabled" + usevserver=1 + fi +fi + [ "$destdir" != "" ] || fatal "Destination directory not set" if [ "$desttype" == "remote" ]; then @@ -54,7 +67,8 @@ fi [ "$label" != "" ] || fatal "Source missing label" [ "$sourcetype" == "local" ] || fatal "Only local source type supported" -[ "$include" != "" ] || fatal "No source includes specified" +[ "$include" != "" -o "$vsinclude" != "" ] || fatal "No source includes specified" +#TODO should I test for vsinclude if usevservers=1? execstr_clientpart="/" @@ -101,6 +115,19 @@ for i in $include; do execstr="${execstr}--include '$str' " done +# vsinclude +if [ $usevserver ] +then + for vserver in `ls $VROOTDIR|grep -v lost+found` + do + for vi in $vsinclude + do + str="${vi//__star__/*}" + execstr="${execstr}--include '$VROOTDIR/$vserver$str' " + done + done +fi + # exclude everything else execstr="${execstr}--exclude '/*' " |