]> oss.titaniummirror.com Git - ovzbpc.git/commitdiff
Add a commend to restartve so it is clear when the restart has finished and
authorsmckown <smckown@986fd584-583e-0410-b54d-b9fe63dff8e5>
Fri, 6 Jun 2008 02:00:53 +0000 (02:00 +0000)
committersmckown <smckown@986fd584-583e-0410-b54d-b9fe63dff8e5>
Fri, 6 Jun 2008 02:00:53 +0000 (02:00 +0000)
bpcdump is on to the next subtask of the backup process.  Also, have bpcdump
save the VE's configuration files into its /etc/vzdump directory prior to
starting the backup, just like vzdump does.

bpcdump

diff --git a/bpcdump b/bpcdump
index ac68f0e9a81b915f01d9f86f68f6895044391001..5bd886a5b47229e53a4a02569655a7f376308b39 100755 (executable)
--- a/bpcdump
+++ b/bpcdump
@@ -19,6 +19,8 @@ EXTFS=/media/esata
 unset WRITEPAR
 INFO=/dev/null
 export PATH=/usr/local/sbin:/usr/local/bin:/sbin:/usr/sbin:$PATH
+SCRIPT_EXT="start stop mount umount"
+CONF_DIR=/etc/vz/conf
 
 # FUNCTIONS
 
@@ -41,6 +43,10 @@ restartve()
     if [ -n "$running" ]; then
        info "restarting VEID $VEID"
        vzctl start $VEID && unset running
+       if [ $? = 0 ]; then
+         info "VEID $VEID has been started"
+       else
+         error "VEID $VEID failed to start; backup continues"
     fi
 }
 
@@ -114,6 +120,17 @@ if [ -n "$running" ]; then
     vzctl stop $VEID
 fi
 
+# Copy the VE's configuration file into its /etc/vzdump directory, as vzdump
+# does (for consistency)
+for file in $(echo "$SCRIPT_EXT"); do
+    if [ -f "$file" ]; then
+       destdir="${VEMNT}/etc/vzdump"
+       mkdir -p "$destdir"
+       info "Preserve config file ${VEID}.${SCRIPT_EXT}"
+       cp "${CONF_DIR}/${VEID}.${SCRIPT_EXT}" "${destdir}/vps.${SCRIPT_EXT}"
+    fi
+done
+
 # Unmount the filesystem, first getting its size
 if mount | grep -q "on $VEMNT"; then
     mounted=1 # duplicate; vzctl status told us...