aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrhatto <rhatto@370017ae-e619-0410-ac65-c121f96126d4>2006-09-21 18:33:01 +0000
committerrhatto <rhatto@370017ae-e619-0410-ac65-c121f96126d4>2006-09-21 18:33:01 +0000
commit47a4adab572c4959806a8bac92d516afe6e01306 (patch)
tree6a09f53b4e0bb3cbc8fd15e5f7561585f6ec1b86
parent5be980fee81f44513b80bdcf8ff2aba6dcc081c7 (diff)
downloadslackbuilds-47a4adab572c4959806a8bac92d516afe6e01306.tar.gz
slackbuilds-47a4adab572c4959806a8bac92d516afe6e01306.tar.bz2
backupninja: rub handler support for vservers
git-svn-id: svn+slack://slack.fluxo.info/var/svn/slackbuilds@254 370017ae-e619-0410-ac65-c121f96126d4
-rwxr-xr-xbackupninja/backupninja.SlackBuild2
-rw-r--r--backupninja/rub24
2 files changed, 22 insertions, 4 deletions
diff --git a/backupninja/backupninja.SlackBuild b/backupninja/backupninja.SlackBuild
index bfb7f804..a67936d4 100755
--- a/backupninja/backupninja.SlackBuild
+++ b/backupninja/backupninja.SlackBuild
@@ -18,7 +18,7 @@ fi
PACKAGE="backupninja"
ARCH="noarch"
VERSION=${VERSION:=0.9.3}
-BUILD=${BUILD:=2rha}
+BUILD=${BUILD:=3rha}
SRC_DIR=${SRC:=$CWD}
TMP=${TMP:=/tmp}
REPOS=${REPOS:=$TMP}
diff --git a/backupninja/rub b/backupninja/rub
index 55b18f4d..1d4fcd30 100644
--- a/backupninja/rub
+++ b/backupninja/rub
@@ -25,14 +25,14 @@
# from = local or remote
# ssh = ssh command line (remote only)
# rsync = rsync command line
+# exclude_vserver = vserver-name (valid only if vservers = yes on backupninja.conf)
#
# [services]
# initscripts = absolute path where scripts are located
# service = script name to be stoped at the begining of the backup and started at its end
#
-# TODO: support for better vserver inclusion/exclusion, like:
-# vservers = yes (global or local config)
-# exclude_vserver = vserver-name
+# You dont need to manually specify vservers using "include = /vservers".
+# They are automatically backuped ff vserver is set to "yes" on you backupninja.conf.
#
setsection general
@@ -54,6 +54,7 @@ getconf user
getconf host
getconf include
getconf exclude
+getconf exclude_vserver
setsection services
getconf initscripts
@@ -130,6 +131,23 @@ if [ "$read_only" == "1" ] || [ "$read_only" == "yes" ]; then
fi
fi
+if [ "$vservers_are_available" == "yes" ]; then
+ for candidate in `ls $VROOTDIR`; do
+ found_excluded_vserver="0"
+ if [ "$candidate" != "lost+found" ]; then
+ for excluded_vserver in $exclude_vserver; do
+ if [ "$excluded_vserver" == "$candidate" ]; then
+ found_excluded_vserver="1"
+ break
+ fi
+ done
+ if [ "$found_excluded_vserver" == "0" ]; then
+ include="$include $VROOTDIR/$candidate"
+ fi
+ fi
+ done
+fi
+
for SECTION in $include; do
section="`basename $SECTION`"