mysql and dup handlers: when using a vserver, check if it is running
authorintrigeri <intrigeri@boum.org>
Sat, 27 Aug 2005 00:19:50 +0000 (00:19 +0000)
committerintrigeri <intrigeri@boum.org>
Sat, 27 Aug 2005 00:19:50 +0000 (00:19 +0000)
changelog
handlers/mysql
handlers/pgsql
handlers/svn

index 2dae7ad5f3a95d2c113a058e9575e25b44e77ad4..8e056cfb238a58176e41a0b789ff37783ea04aa4 100644 (file)
--- a/changelog
+++ b/changelog
@@ -27,6 +27,8 @@ version 0.8 --
           then nano, vim and vi, and aborts if none of these exists.
     added helper for pgsql handler.
     rdiff handler now does not require 'label'
           then nano, vim and vi, and aborts if none of these exists.
     added helper for pgsql handler.
     rdiff handler now does not require 'label'
+    changes to mysql and svn handlers' vservers support
+        these handlers now check if the source vserver is running
 
 version 0.7 -- July 26 2005
        added ninjahelper: a dialog based wizard for creating backupninja configs.
 
 version 0.7 -- July 26 2005
        added ninjahelper: a dialog based wizard for creating backupninja configs.
index d5c0370e733c9252c217e574cfd0c1a2af0fea89..e5306db4c5a42adafcafeb87e31f29f24c163328 100644 (file)
@@ -39,11 +39,16 @@ then
        fi
 fi
 
        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
 if [ $usevserver ]
 then
+        info "examining vserver '$vsname'"
+        # does it exist ?
        vroot="$VROOTDIR/$vsname"
        [ -d $vroot ] || fatal "vserver '$vsname' does not exist at '$vroot'"
        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
 fi
        
 # create backup dirs, the vroot variable will be empty if no vsname was specified
index 11a5cfef772475fbed210b7e474212034cd255e8..9b1d8b7f4de134fae545e2490c3a98b53ed54022 100644 (file)
@@ -1,3 +1,4 @@
+#! /bin/sh
 #
 # PostgreSQL handler script for backupninja
 #
 #
 # PostgreSQL handler script for backupninja
 #
index 551255b943038d6226b95a97f6735a3b978541f5..6ac54029547665829ba01b09ccbd47a19e18d784 100644 (file)
@@ -23,11 +23,16 @@ then
        fi
 fi
 
        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
 if [ $usevserver ]
 then
+       info "examining vserver '$vsname'"
+        # does it exist ?
        vroot="$VROOTDIR/$vsname"
        [ -d $vroot ] || fatal "vserver '$vsname' does not exist at '$vroot'"
        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
 fi
 
 cd $vroot$src