diff options
author | rhatto <rhatto@370017ae-e619-0410-ac65-c121f96126d4> | 2006-09-21 18:33:01 +0000 |
---|---|---|
committer | rhatto <rhatto@370017ae-e619-0410-ac65-c121f96126d4> | 2006-09-21 18:33:01 +0000 |
commit | 47a4adab572c4959806a8bac92d516afe6e01306 (patch) | |
tree | 6a09f53b4e0bb3cbc8fd15e5f7561585f6ec1b86 /backupninja/rub | |
parent | 5be980fee81f44513b80bdcf8ff2aba6dcc081c7 (diff) | |
download | slackbuilds-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
Diffstat (limited to 'backupninja/rub')
-rw-r--r-- | backupninja/rub | 24 |
1 files changed, 21 insertions, 3 deletions
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`" |