Older Newer
Wed, 02 Aug 2006 17:12:12 . . . . cpe-24-27-11-33.austin.res.rr.com
Wed, 02 Aug 2006 16:37:37 . . . . cpe-24-27-11-33.austin.res.rr.com
Wed, 02 Aug 2006 15:55:29 . . . . cpe-24-27-11-33.austin.res.rr.com
Wed, 02 Aug 2006 15:54:21 . . . . cpe-24-27-11-33.austin.res.rr.com
Wed, 02 Aug 2006 15:54:21 . . . . cpe-24-27-11-33.austin.res.rr.com
Wed, 02 Aug 2006 15:52:42 . . . . 20179112195.user.veloxzone.com.br
Wed, 02 Aug 2006 15:47:23 . . . . 20179112195.user.veloxzone.com.br


Changes by last author:

Changed:
* USE IT AT YOUR OWN RISK *
USE IT AT YOUR OWN RISK
Changed:
-- vserver_snapshot_create.sh -- cut here -------------------------------------------
<code>
Added:
</code>
Changed:
-- vserver_snapshot_create.sh -- cut here -------------------------------------------
And to restore a snapshot... do:

<code>

#!/bin/bash

# [by MarkS? AKA Skram; mark@SentienSystems?.com

# Restores VServer snapshots which were made with brc_ (Bruce)'s vserver_snapshot_create.sh AKA vserver-snapmake

#

# Run: vserver-snaprestore vserver_name

#

# Purpose: Restore a snapshot of a VServer

#

# * PLEASE USE THIS AT YOUR OWN RISK *

#

# Configuration files:

# Where are snapshots going to be mounted?

SNAPSHOT_MOUNT_DIR=/tmp/snapshots_mounted

# Where are snapshots going to be stored?

SNAPSHOT_DIR=/nas/1/vserver-snapshots

# Vserver

VSERVER_DIR=/vservers/

# Checking arguments

if [ $# -ne 1 ]; then

echo 1>&2 Usage: $0 vserver_name

exit 0

fi

VSERVER=$1

SNAPSHOT_FILE=$SNAPSHOT_DIR/$1.img

# Checking if directories exist

if [ ! -d $SNAPSHOT_MOUNT_DIR ]

then

echo "SNAPSHOT_MOUNT_DIR $SNAPSHOT_MOUNT_DIR does not exist"

exit 1

fi

if [ ! -d $SNAPSHOT_DIR ]

then

echo "SNAPSHOT_DIR $SNAPSHOT_DIR does not exist"

exit 1

fi

# Checking if snapshot file already exists

if [ ! -e $SNAPSHOT_FILE ]

# if it doesnt.. make it!

then

echo "$SNAPSHOT_DIR/$VSERVER.img doesn't exist; use 'vserver-snapmake $VSERVER SIZE_IN_MB' to create it"

fi

# Restoring Snapshot...

mkdir $SNAPSHOT_MOUNT_DIR/$VSERVER

mount $SNAPSHOT_DIR/$1.img $SNAPSHOT_MOUNT_DIR/$VSERVER -o loop

rsync $SNAPSHOT_MOUNT_DIR $VSERVER_DIR/$VSERVER

umount $SNAPSHOT_MOUNT_DIR/$VSERVER

echo "If there were not any errors, your snapshot is probrably restored at $VSERVER/$1/"

</code>