From: smckown Date: Fri, 6 Jun 2008 02:00:53 +0000 (+0000) Subject: Add a commend to restartve so it is clear when the restart has finished and X-Git-Url: https://oss.titaniummirror.com/gitweb?a=commitdiff_plain;h=cd20ca2b5c9c447e9d8a022ff0cda596deac6558;p=ovzbpc.git Add a commend to restartve so it is clear when the restart has finished and 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. --- diff --git a/bpcdump b/bpcdump index ac68f0e..5bd886a 100755 --- 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...