aboutsummaryrefslogtreecommitdiff
path: root/handlers
diff options
context:
space:
mode:
authorintrigeri <intrigeri@boum.org>2005-08-27 00:19:50 +0000
committerintrigeri <intrigeri@boum.org>2005-08-27 00:19:50 +0000
commitcf1817d075b934aeab77d7bf10da3bf886b034ae (patch)
tree129f8d7ac5c6f0ca954e1e77b604a5705febeb4b /handlers
parentbd0b2eaea8db2aecd8ba6f061901d4a41a0881a2 (diff)
downloadbackupninja-cf1817d075b934aeab77d7bf10da3bf886b034ae.tar.gz
backupninja-cf1817d075b934aeab77d7bf10da3bf886b034ae.tar.bz2
mysql and dup handlers: when using a vserver, check if it is running
Diffstat (limited to 'handlers')
-rw-r--r--handlers/mysql7
-rw-r--r--handlers/pgsql1
-rw-r--r--handlers/svn7
3 files changed, 13 insertions, 2 deletions
diff --git a/handlers/mysql b/handlers/mysql
index d5c0370..e5306db 100644
--- a/handlers/mysql
+++ b/handlers/mysql
@@ -39,11 +39,16 @@ then
fi
fi
-# Check to make sure that the specified vserver exists
+# If needed, make sure that the specified vserver exists and is running.
if [ $usevserver ]
then
+ info "examining vserver '$vsname'"
+ # does it exist ?
vroot="$VROOTDIR/$vsname"
[ -d $vroot ] || fatal "vserver '$vsname' does not exist at '$vroot'"
+ # is it running ?
+ running=`$VSERVERINFO $vsname RUNNING`
+ [ $running = 1 ] || fatal "vserver $vsname is not running."
fi
# create backup dirs, the vroot variable will be empty if no vsname was specified
diff --git a/handlers/pgsql b/handlers/pgsql
index 11a5cfe..9b1d8b7 100644
--- a/handlers/pgsql
+++ b/handlers/pgsql
@@ -1,3 +1,4 @@
+#! /bin/sh
#
# PostgreSQL handler script for backupninja
#
diff --git a/handlers/svn b/handlers/svn
index 551255b..6ac5402 100644
--- a/handlers/svn
+++ b/handlers/svn
@@ -23,11 +23,16 @@ then
fi
fi
-# Check to make sure that the specified vserver exists
+# If needed, make sure that the specified vserver exists and is running.
if [ $usevserver ]
then
+ info "examining vserver '$vsname'"
+ # does it exist ?
vroot="$VROOTDIR/$vsname"
[ -d $vroot ] || fatal "vserver '$vsname' does not exist at '$vroot'"
+ # is it running ?
+ running=`$VSERVERINFO $vsname RUNNING`
+ [ $running = 1 ] || fatal "vserver $vsname is not running."
fi
cd $vroot$src