<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.openvz.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Alla</id>
	<title>OpenVZ Virtuozzo Containers Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.openvz.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Alla"/>
	<link rel="alternate" type="text/html" href="https://wiki.openvz.org/Special:Contributions/Alla"/>
	<updated>2026-05-15T18:44:04Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.31.1</generator>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Backup_a_running_container_over_the_network_with_ezvzdump&amp;diff=6387</id>
		<title>Backup a running container over the network with ezvzdump</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Backup_a_running_container_over_the_network_with_ezvzdump&amp;diff=6387"/>
		<updated>2008-08-28T15:50:15Z</updated>

		<summary type="html">&lt;p&gt;Alla: Slight modification to the ezvzdump script for when no remote host is defined.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Ezvzdump ==&lt;br /&gt;
&lt;br /&gt;
Ezvzdump (not to be confused with vzdump) is a shell script that also allows &lt;br /&gt;
you to dump out a running VE container. The key differences are that ezvzdump &lt;br /&gt;
allows you to utilize past dumps to speed things up, and that a remote host can &lt;br /&gt;
be specified to allow backups and tar archiving over the network.&lt;br /&gt;
&lt;br /&gt;
The dump files that are created are compatible with those that vzdump creates, &lt;br /&gt;
so you must still use `vzdump --restore` to restore them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
# &lt;br /&gt;
# ezvzdump &lt;br /&gt;
#&lt;br /&gt;
# Copyright (C) 2008 Alex Lance (alla at cyber.com.au)&lt;br /&gt;
# Sponsored by Silverband Pty. Ltd. &lt;br /&gt;
# &lt;br /&gt;
# This program is free software: you can redistribute it and/or modify&lt;br /&gt;
# it under the terms of the GNU General Public License as published by the Free&lt;br /&gt;
# Software Foundation, either version 3 of the License, or (at your option) any&lt;br /&gt;
# later version.&lt;br /&gt;
# &lt;br /&gt;
# This program is distributed in the hope that it will be useful, but&lt;br /&gt;
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or&lt;br /&gt;
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for&lt;br /&gt;
# more details: http://www.gnu.org/licenses/gpl.txt&lt;br /&gt;
# &lt;br /&gt;
#&lt;br /&gt;
# Instructions &lt;br /&gt;
# ------------&lt;br /&gt;
#&lt;br /&gt;
# This script rsyncs a VE to a specified local directory, suspends the running&lt;br /&gt;
# VE, rsyncs again, and then resumes the VE. This creates a stable snapshot of&lt;br /&gt;
# the VE directories with minimal downtime.&lt;br /&gt;
#&lt;br /&gt;
# Once the VE has been dumped out locally, it is rsynced to a remote host. When&lt;br /&gt;
# the rsync has completed, a tar archive is created on the remote host. The tar&lt;br /&gt;
# archive is compatible with the vzdump tar format, so the VE tar file may be&lt;br /&gt;
# later restored with the `vzdump --restore` command.&lt;br /&gt;
#&lt;br /&gt;
# By tarring the files together on the remote host, the burden of creating&lt;br /&gt;
# the tar archive is taken away from the hardware node, and given to the remote&lt;br /&gt;
# host / backup server. This ensures that minimal additional CPU/disk resources&lt;br /&gt;
# are used on the machine that is running the VE's.&lt;br /&gt;
#&lt;br /&gt;
# This script runs slow the first time you use it, but from then on it utilizes&lt;br /&gt;
# the local and remote stored snapshot directories so that the rsyncs happen&lt;br /&gt;
# expediently. The script does not wait for the remote tar process to complete,&lt;br /&gt;
# it simply kicks off the tar archive creation and then immediately continues.&lt;br /&gt;
#&lt;br /&gt;
# This script uses rsync and ssh and assumes that you already have ssh keys&lt;br /&gt;
# set up between your hosts. This script was written because vzdump takes too&lt;br /&gt;
# long and does not utilize a local cache, and also does not do network&lt;br /&gt;
# backups. This script also puts less strain on the hardware node by finishing&lt;br /&gt;
# backups more quickly, and making the remote host do the heavy lifting.&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# This section contains variables that require user customisation. &lt;br /&gt;
# NOTE: all directory names *must* end in a forward-slash. &lt;br /&gt;
 &lt;br /&gt;
# This variable contains a space delimited list of VEID's to be backed up.&lt;br /&gt;
# You can use VEIDS=&amp;quot;$(cd /vz/private/ &amp;amp;&amp;amp; echo *)&amp;quot;  to backup all your VE's.&lt;br /&gt;
VEIDS=&amp;quot;1000 2000 3000&amp;quot;              &lt;br /&gt;
&lt;br /&gt;
VZ_CONF=&amp;quot;/etc/vz/conf/&amp;quot;             # the path to your openvz $VEID.conf files&lt;br /&gt;
VZ_PRIVATE=&amp;quot;/vz/private/&amp;quot;           # the path to the running VE's&lt;br /&gt;
LOCAL_DIR=&amp;quot;/vz/ezvzdump/&amp;quot;           # the local rsync cache / destination directory &lt;br /&gt;
 &lt;br /&gt;
# The remote host and path that this script will rsync the VE's to.&lt;br /&gt;
REMOTE_HOST=&amp;quot;somehost.example.com&amp;quot;&lt;br /&gt;
REMOTE_DIR=&amp;quot;/backup/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
# Default rsync flags (please note the potentially unsafe delete flags).&lt;br /&gt;
# You can also remove the v flag to get less verbose logging.&lt;br /&gt;
RSYNC_DEFAULT=&amp;quot;rsync -ravH --delete-after --delete-excluded&amp;quot; &lt;br /&gt;
RSYNC_EXCLUDE=&amp;quot;/usr/portage /var/log&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Path to vzctl executable&lt;br /&gt;
VZCTL=&amp;quot;vzctl&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
# Nice debugging messages...&lt;br /&gt;
function e { &lt;br /&gt;
  echo -e $(date &amp;quot;+%F %T&amp;quot;):  $1 &lt;br /&gt;
}&lt;br /&gt;
function die {&lt;br /&gt;
  e &amp;quot;Error: $1&amp;quot; &amp;gt;&amp;amp;2&lt;br /&gt;
  exit 1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# Make sure all is sane&lt;br /&gt;
[ ! -d &amp;quot;${VZ_CONF}&amp;quot; ]    &amp;amp;&amp;amp; die &amp;quot;\$VZ_CONF directory doesn't exist. ($VZ_CONF)&amp;quot;&lt;br /&gt;
[ ! -d &amp;quot;${VZ_PRIVATE}&amp;quot; ] &amp;amp;&amp;amp; die &amp;quot;\$VZ_PRIVATE directory doesn't exist. ($VZ_PRIVATE)&amp;quot;&lt;br /&gt;
[ ! -d &amp;quot;${LOCAL_DIR}&amp;quot; ]  &amp;amp;&amp;amp; die &amp;quot;\$LOCAL_DIR directory doesn't exist. ($LOCAL_DIR)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Loop through each VEID&lt;br /&gt;
for VEID in $VEIDS; do&lt;br /&gt;
&lt;br /&gt;
  echo &amp;quot;&amp;quot;&lt;br /&gt;
  e &amp;quot;Beginning backup of VEID: $VEID&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  # Build up the --exclude string for the rsync command&lt;br /&gt;
  RSYNC=&amp;quot;${RSYNC_DEFAULT}&amp;quot;&lt;br /&gt;
  for path in $RSYNC_EXCLUDE; do&lt;br /&gt;
    RSYNC+=&amp;quot; --exclude=${VEID}${path}&amp;quot;&lt;br /&gt;
  done;&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
  e &amp;quot;Commencing initial ${RSYNC} ${VZ_PRIVATE}${VEID} ${LOCAL_DIR}&amp;quot;&lt;br /&gt;
  [ ! -d &amp;quot;${VZ_PRIVATE}${VEID}&amp;quot; ] &amp;amp;&amp;amp; die &amp;quot;\$VZ_PRIVATE\$VEID directory doesn't exist. (${VZ_PRIVATE}${VEID})&amp;quot;&lt;br /&gt;
  ${RSYNC} ${VZ_PRIVATE}${VEID} ${LOCAL_DIR}&lt;br /&gt;
&lt;br /&gt;
  # If the VE is running, suspend, re-rsync and then resume it ...&lt;br /&gt;
  if [ -n &amp;quot;$(${VZCTL} status ${VEID} | grep running)&amp;quot; ]; then&lt;br /&gt;
&lt;br /&gt;
    e &amp;quot;Suspending VEID: $VEID&amp;quot;&lt;br /&gt;
    ${VZCTL} chkpnt $VEID --suspend&lt;br /&gt;
  &lt;br /&gt;
    e &amp;quot;Commencing second pass rsync ...&amp;quot;&lt;br /&gt;
    ${RSYNC} ${VZ_PRIVATE}${VEID} ${LOCAL_DIR}&lt;br /&gt;
  &lt;br /&gt;
    e &amp;quot;Resuming VEID: $VEID&amp;quot;&lt;br /&gt;
    ${VZCTL} chkpnt $VEID --resume&lt;br /&gt;
&lt;br /&gt;
    e &amp;quot;Done.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  else&lt;br /&gt;
    e &amp;quot;# # # Skipping suspend/re-rsync/resume, as the VEID: ${VEID} is not curently running.&amp;quot;&lt;br /&gt;
  fi&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
  # Copy VE config files over into the VE storage/cache area&lt;br /&gt;
  if [ ! -d &amp;quot;${LOCAL_DIR}${VEID}/etc/vzdump&amp;quot; ]; then &lt;br /&gt;
    e &amp;quot;Creating directory for openvz config files: mkdir ${LOCAL_DIR}${VEID}/etc/vzdump&amp;quot;&lt;br /&gt;
    mkdir ${LOCAL_DIR}${VEID}/etc/vzdump&lt;br /&gt;
  fi&lt;br /&gt;
&lt;br /&gt;
  e &amp;quot;Copying main config file: cp ${VZ_CONF}${VEID}.conf ${LOCAL_DIR}${VEID}/etc/vzdump/vps.conf&amp;quot;&lt;br /&gt;
  [ ! -f &amp;quot;${VZ_CONF}${VEID}.conf&amp;quot; ] &amp;amp;&amp;amp; die &amp;quot;Unable to find ${VZ_CONF}${VEID}.conf&amp;quot;&lt;br /&gt;
  cp ${VZ_CONF}${VEID}.conf ${LOCAL_DIR}${VEID}/etc/vzdump/vps.conf&lt;br /&gt;
&lt;br /&gt;
  for ext in start stop mount umount; do&lt;br /&gt;
    if [ -f &amp;quot;${VZ_CONF}${VEID}.${ext}&amp;quot; ]; then&lt;br /&gt;
      e &amp;quot;Copying other config file: cp ${VZ_CONF}${VEID}.${ext} ${LOCAL_DIR}${VEID}/etc/vzdump/vps.${ext}&amp;quot;&lt;br /&gt;
      cp ${VZ_CONF}${VEID}.${ext} ${LOCAL_DIR}${VEID}/etc/vzdump/vps.${ext}&lt;br /&gt;
    fi&lt;br /&gt;
  done;&lt;br /&gt;
&lt;br /&gt;
  # Run the remote rsync&lt;br /&gt;
  if [ -n &amp;quot;${REMOTE_HOST}&amp;quot; ] &amp;amp;&amp;amp; [ -n &amp;quot;${REMOTE_DIR}&amp;quot; ]; then&lt;br /&gt;
    e &amp;quot;Commencing remote ${RSYNC} ${LOCAL_DIR}${VEID} ${REMOTE_HOST}:${REMOTE_DIR}${VEID}&amp;quot;&lt;br /&gt;
    ${RSYNC} ${LOCAL_DIR}${VEID}/ ${REMOTE_HOST}:${REMOTE_DIR}${VEID}/&lt;br /&gt;
&lt;br /&gt;
    # Move old $VEID.tar archive to $VEID.tar.backup&lt;br /&gt;
    e &amp;quot;Checking for existing file ${REMOTE_HOST}:${REMOTE_DIR}${VEID}.tar (and moving it to .backup if exists)&amp;quot;&lt;br /&gt;
    ssh ${REMOTE_HOST} &amp;quot;[ -f ${REMOTE_DIR}${VEID}.tar ] &amp;amp;&amp;amp; mv -f ${REMOTE_DIR}${VEID}.tar ${REMOTE_DIR}${VEID}.tar.backup&amp;quot;&lt;br /&gt;
&lt;br /&gt;
    # Create a remote tar archive - note you can remove the ampersand from the end if you&lt;br /&gt;
    # don't want multiple tar processes running on the remote host simultaneously.&lt;br /&gt;
    e &amp;quot;Making a tar archive on remote host (this process will run in the background on the remote host).&amp;quot;&lt;br /&gt;
    ssh ${REMOTE_HOST} &amp;quot;tar cf ${REMOTE_DIR}${VEID}.tar -C ${REMOTE_DIR}${VEID} ./ 2&amp;gt;/dev/null &amp;quot; &amp;amp;&lt;br /&gt;
  fi&lt;br /&gt;
&lt;br /&gt;
  e &amp;quot;Done.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
done;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:HOWTO]]&lt;/div&gt;</summary>
		<author><name>Alla</name></author>
		
	</entry>
	<entry>
		<id>https://wiki.openvz.org/index.php?title=Backup_a_running_container_over_the_network_with_ezvzdump&amp;diff=6386</id>
		<title>Backup a running container over the network with ezvzdump</title>
		<link rel="alternate" type="text/html" href="https://wiki.openvz.org/index.php?title=Backup_a_running_container_over_the_network_with_ezvzdump&amp;diff=6386"/>
		<updated>2008-08-28T11:25:48Z</updated>

		<summary type="html">&lt;p&gt;Alla: Added ezvzdump script.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Ezvzdump ==&lt;br /&gt;
&lt;br /&gt;
Ezvzdump (not to be confused with vzdump) is a shell script that also allows &lt;br /&gt;
you to dump out a running VE container. The key differences are that ezvzdump &lt;br /&gt;
allows you to utilize past dumps to speed things up, and that a remote host can &lt;br /&gt;
be specified to allow backups and tar archiving over the network.&lt;br /&gt;
&lt;br /&gt;
The dump files that are created are compatible with those that vzdump creates, &lt;br /&gt;
so you must still use `vzdump --restore` to restore them.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Download ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
# &lt;br /&gt;
# ezvzdump &lt;br /&gt;
#&lt;br /&gt;
# Copyright (C) 2008 Alex Lance (alla at cyber.com.au)&lt;br /&gt;
# Sponsored by Silverband Pty. Ltd. &lt;br /&gt;
# &lt;br /&gt;
# This program is free software: you can redistribute it and/or modify&lt;br /&gt;
# it under the terms of the GNU General Public License as published by the Free&lt;br /&gt;
# Software Foundation, either version 3 of the License, or (at your option) any&lt;br /&gt;
# later version.&lt;br /&gt;
# &lt;br /&gt;
# This program is distributed in the hope that it will be useful, but&lt;br /&gt;
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or&lt;br /&gt;
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for&lt;br /&gt;
# more details: http://www.gnu.org/licenses/gpl.txt&lt;br /&gt;
# &lt;br /&gt;
#&lt;br /&gt;
# Instructions &lt;br /&gt;
# ------------&lt;br /&gt;
#&lt;br /&gt;
# This script rsyncs a VE to a specified local directory, suspends the running&lt;br /&gt;
# VE, rsyncs again, and then resumes the VE. This creates a stable snapshot of&lt;br /&gt;
# the VE directories with minimal downtime.&lt;br /&gt;
#&lt;br /&gt;
# Once the VE has been dumped out locally, it is rsynced to a remote host. When&lt;br /&gt;
# the rsync has completed, a tar archive is created on the remote host. The tar&lt;br /&gt;
# archive is compatible with the vzdump tar format, so the VE tar file may be&lt;br /&gt;
# later restored with the `vzdump --restore` command.&lt;br /&gt;
#&lt;br /&gt;
# By tarring the files together on the remote host, the burden of creating&lt;br /&gt;
# the tar archive is taken away from the hardware node, and given to the remote&lt;br /&gt;
# host / backup server. This ensures that minimal additional CPU/disk resources&lt;br /&gt;
# are used on the machine that is running the VE's.&lt;br /&gt;
#&lt;br /&gt;
# This script runs slow the first time you use it, but from then on it utilizes&lt;br /&gt;
# the local and remote stored snapshot directories so that the rsyncs happen&lt;br /&gt;
# expediently. The script does not wait for the remote tar process to complete,&lt;br /&gt;
# it simply kicks off the tar archive creation and then immediately continues.&lt;br /&gt;
#&lt;br /&gt;
# This script uses rsync and ssh and assumes that you already have ssh keys&lt;br /&gt;
# set up between your hosts. This script was written because vzdump takes too&lt;br /&gt;
# long and does not utilize a local cache, and also does not do network&lt;br /&gt;
# backups. This script also puts less strain on the hardware node by finishing&lt;br /&gt;
# backups more quickly, and making the remote host do the heavy lifting.&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# This section contains variables that require user customisation. &lt;br /&gt;
# NOTE: all directory names *must* end in a forward-slash. &lt;br /&gt;
 &lt;br /&gt;
# This variable contains a space delimited list of VEID's to be backed up.&lt;br /&gt;
# You can use VEIDS=&amp;quot;$(cd /vz/private/ &amp;amp;&amp;amp; echo *)&amp;quot;  to backup all your VE's.&lt;br /&gt;
VEIDS=&amp;quot;1000 2000 3000&amp;quot;              &lt;br /&gt;
&lt;br /&gt;
VZ_CONF=&amp;quot;/etc/vz/conf/&amp;quot;             # the path to your openvz $VEID.conf files&lt;br /&gt;
VZ_PRIVATE=&amp;quot;/vz/private/&amp;quot;           # the path to the running VE's&lt;br /&gt;
LOCAL_DIR=&amp;quot;/vz/ezvzdump/&amp;quot;           # the local rsync cache / destination directory &lt;br /&gt;
 &lt;br /&gt;
# The remote host and path that this script will rsync the VE's to.&lt;br /&gt;
REMOTE_HOST=&amp;quot;somehost.example.com&amp;quot;&lt;br /&gt;
REMOTE_DIR=&amp;quot;/backup/&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
# Default rsync flags (please note the potentially unsafe delete flags).&lt;br /&gt;
# You can also remove the v flag to get less verbose logging.&lt;br /&gt;
RSYNC_DEFAULT=&amp;quot;rsync -ravH --delete-after --delete-excluded&amp;quot; &lt;br /&gt;
RSYNC_EXCLUDE=&amp;quot;/usr/portage /var/log&amp;quot;&lt;br /&gt;
&lt;br /&gt;
# Path to vzctl executable&lt;br /&gt;
VZCTL=&amp;quot;vzctl&amp;quot;&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
# Nice debugging messages...&lt;br /&gt;
function e { &lt;br /&gt;
  echo -e $(date &amp;quot;+%F %T&amp;quot;):  $1 &lt;br /&gt;
}&lt;br /&gt;
function die {&lt;br /&gt;
  e &amp;quot;Error: $1&amp;quot; &amp;gt;&amp;amp;2&lt;br /&gt;
  exit 1;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
# Make sure all is sane&lt;br /&gt;
[ ! -d &amp;quot;${VZ_CONF}&amp;quot; ]    &amp;amp;&amp;amp; die &amp;quot;\$VZ_CONF directory doesn't exist. ($VZ_CONF)&amp;quot;&lt;br /&gt;
[ ! -d &amp;quot;${VZ_PRIVATE}&amp;quot; ] &amp;amp;&amp;amp; die &amp;quot;\$VZ_PRIVATE directory doesn't exist. ($VZ_PRIVATE)&amp;quot;&lt;br /&gt;
[ ! -d &amp;quot;${LOCAL_DIR}&amp;quot; ]  &amp;amp;&amp;amp; die &amp;quot;\$LOCAL_DIR directory doesn't exist. ($LOCAL_DIR)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
# Loop through each VEID&lt;br /&gt;
for VEID in $VEIDS; do&lt;br /&gt;
&lt;br /&gt;
  echo &amp;quot;&amp;quot;&lt;br /&gt;
  e &amp;quot;Beginning backup of VEID: $VEID&amp;quot;;&lt;br /&gt;
&lt;br /&gt;
  # Build up the --exclude string for the rsync command&lt;br /&gt;
  RSYNC=&amp;quot;${RSYNC_DEFAULT}&amp;quot;&lt;br /&gt;
  for path in $RSYNC_EXCLUDE; do&lt;br /&gt;
    RSYNC+=&amp;quot; --exclude=${VEID}${path}&amp;quot;&lt;br /&gt;
  done;&lt;br /&gt;
   &lt;br /&gt;
&lt;br /&gt;
  e &amp;quot;Commencing initial ${RSYNC} ${VZ_PRIVATE}${VEID} ${LOCAL_DIR}&amp;quot;&lt;br /&gt;
  [ ! -d &amp;quot;${VZ_PRIVATE}${VEID}&amp;quot; ] &amp;amp;&amp;amp; die &amp;quot;\$VZ_PRIVATE\$VEID directory doesn't exist. (${VZ_PRIVATE}${VEID})&amp;quot;&lt;br /&gt;
  ${RSYNC} ${VZ_PRIVATE}${VEID} ${LOCAL_DIR}&lt;br /&gt;
&lt;br /&gt;
  # If the VE is running, suspend, re-rsync and then resume it ...&lt;br /&gt;
  if [ -n &amp;quot;$(${VZCTL} status ${VEID} | grep running)&amp;quot; ]; then&lt;br /&gt;
&lt;br /&gt;
    e &amp;quot;Suspending VEID: $VEID&amp;quot;&lt;br /&gt;
    ${VZCTL} chkpnt $VEID --suspend&lt;br /&gt;
  &lt;br /&gt;
    e &amp;quot;Commencing second pass rsync ...&amp;quot;&lt;br /&gt;
    ${RSYNC} ${VZ_PRIVATE}${VEID} ${LOCAL_DIR}&lt;br /&gt;
  &lt;br /&gt;
    e &amp;quot;Resuming VEID: $VEID&amp;quot;&lt;br /&gt;
    ${VZCTL} chkpnt $VEID --resume&lt;br /&gt;
&lt;br /&gt;
    e &amp;quot;Done.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  else&lt;br /&gt;
    e &amp;quot;# # # Skipping suspend/re-rsync/resume, as the VEID: ${VEID} is not curently running.&amp;quot;&lt;br /&gt;
  fi&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
  # Copy VE config files over into the VE storage/cache area&lt;br /&gt;
  if [ ! -d &amp;quot;${LOCAL_DIR}${VEID}/etc/vzdump&amp;quot; ]; then &lt;br /&gt;
    e &amp;quot;Creating directory for openvz config files: mkdir ${LOCAL_DIR}${VEID}/etc/vzdump&amp;quot;&lt;br /&gt;
    mkdir ${LOCAL_DIR}${VEID}/etc/vzdump&lt;br /&gt;
  fi&lt;br /&gt;
&lt;br /&gt;
  e &amp;quot;Copying main config file: cp ${VZ_CONF}${VEID}.conf ${LOCAL_DIR}${VEID}/etc/vzdump/vps.conf&amp;quot;&lt;br /&gt;
  [ ! -f &amp;quot;${VZ_CONF}${VEID}.conf&amp;quot; ] &amp;amp;&amp;amp; die &amp;quot;Unable to find ${VZ_CONF}${VEID}.conf&amp;quot;&lt;br /&gt;
  cp ${VZ_CONF}${VEID}.conf ${LOCAL_DIR}${VEID}/etc/vzdump/vps.conf&lt;br /&gt;
&lt;br /&gt;
  for ext in start stop mount umount; do&lt;br /&gt;
    if [ -f &amp;quot;${VZ_CONF}${VEID}.${ext}&amp;quot; ]; then&lt;br /&gt;
      e &amp;quot;Copying other config file: cp ${VZ_CONF}${VEID}.${ext} ${LOCAL_DIR}${VEID}/etc/vzdump/vps.${ext}&amp;quot;&lt;br /&gt;
      cp ${VZ_CONF}${VEID}.${ext} ${LOCAL_DIR}${VEID}/etc/vzdump/vps.${ext}&lt;br /&gt;
    fi&lt;br /&gt;
  done;&lt;br /&gt;
&lt;br /&gt;
  # Run the remote rsync&lt;br /&gt;
  if [ -n &amp;quot;${REMOTE_HOST}&amp;quot; ] &amp;amp;&amp;amp; [ -n &amp;quot;${REMOTE_DIR}&amp;quot; ]; then&lt;br /&gt;
    e &amp;quot;Commencing remote ${RSYNC} ${LOCAL_DIR}${VEID} ${REMOTE_HOST}:${REMOTE_DIR}${VEID}&amp;quot;&lt;br /&gt;
    ${RSYNC} ${LOCAL_DIR}${VEID}/ ${REMOTE_HOST}:${REMOTE_DIR}${VEID}/&lt;br /&gt;
  fi&lt;br /&gt;
&lt;br /&gt;
  # Move old $VEID.tar archive to $VEID.tar.backup&lt;br /&gt;
  e &amp;quot;Checking for existing file ${REMOTE_HOST}:${REMOTE_DIR}${VEID}.tar (and moving it to .backup if exists)&amp;quot;&lt;br /&gt;
  ssh ${REMOTE_HOST} &amp;quot;[ -f ${REMOTE_DIR}${VEID}.tar ] &amp;amp;&amp;amp; mv -f ${REMOTE_DIR}${VEID}.tar ${REMOTE_DIR}${VEID}.tar.backup&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  # Create a remote tar archive - note you can remove the ampersand from the end if you&lt;br /&gt;
  # don't want multiple tar processes running on the remote host simultaneously.&lt;br /&gt;
  e &amp;quot;Making a tar archive on remote host (this process will run in the background on the remote host).&amp;quot;&lt;br /&gt;
  ssh ${REMOTE_HOST} &amp;quot;tar cf ${REMOTE_DIR}${VEID}.tar -C ${REMOTE_DIR}${VEID} ./ 2&amp;gt;/dev/null &amp;quot; &amp;amp;&lt;br /&gt;
  &lt;br /&gt;
  e &amp;quot;Done.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
done;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:HOWTO]]&lt;/div&gt;</summary>
		<author><name>Alla</name></author>
		
	</entry>
</feed>