Snapshot of running Servers

We are currently changing our server setup in the office.

We used to have five Servers running in the same CC, but we rented 2 new Servers and now want a total of three - the best of the five old ones and the two new ones.

The first new Server is already set up, we just installed the application there, migrated the Data and the DNS. No Problem here.

But now we have to mix the dozen applications running on the five old servers to two, one of them running an application which I want to transfer.

No way we can do that via hot migration.

Well, of course we have backups, but they are 1 day old, and not directly mountable - which is what we need to mix the applications.

So what I want is a snapshot of each server. It should be ready for emergency-playback and also mountable.

You might say 'thats no big deal, just get a tarball and a mysqldump'. Thats exactly what I'm goin to do. But as I'm lazy, I do only want to dive through manpages once, and maybe this is useful for some1 else, so I post my snapshot/backup-script here:

#!/bin/sh
echo "starting backup of this machine";
########################################################
# By ch3ka, tested and worked with ZSH_VERSION=4.3.2.  #
# As-is, do whatever u want with it but dont blame me. #
# read and understand be4 execution!                   #
# requires 0cuz root privileges on machine and mysql   #
# What it should do: backup ur / and mysqldump to      #
# $tmpdir. Watch out for the --one-file-system switch! #
########################################################
 
#####CONFIG SECTION######
mysqlpw=IAMAMYSQLROOTPW; #ur mysql root-password
 
###MAYBE-CONFIG SECTION##
timestamp=$(date +%Y-%m-%d); #want to tag backups w/ date
tmpdir=/tmp/; #tmpsave in this dir for later scp
hostname=$(cat /etc/hostname); #want to know which machine
fileprefix=${tmpdir}host_${hostname}_${timestamp}; 
 
#####MAGIC SECTION#######
tar \
 --one-file-system  \
 --numeric-owner \
 --exclude=tmp \
 --exclude=var/tmp \
 --verbose --verbose \
 --directory=/ \
 -czf ${fileprefix}.tar.gz . \
 > ${fileprefix}.tar.log \
 2> ${fileprefix}.tar.err || echo "tar exit with errors / warnings";
 
mysqldump -uroot -p${mysqlpw} --all-databases | gzip \
  > ${fileprefix}.sql.gz \
  2> ${fileprefix}.sql.err || echo "mysqldump exit with errors / warnings";
 
echo "End. Your backup files are stored in ${tmpdir}";
echo "named ${fileprefix}.*";
echo "Review the logs and scp them to a safe place.";

DISCLAIMER: It is a long time since I was into shell coding, USE AT OWN RISK
Comments on bad design / techniques are welcome (commendations also *g)

Trackback URL for this post:

http://www.pronweb.de/trackback/45

MPiCHAT

PWtGony MPiCHAT

cialis

yeWksKh cialis 6056 cialis 3358 viagra GLCYB viagra %-[[[

unique watches

This was a genuinely great post. In theory I’d like to create like this also – getting time and true work to make a good content… but what can I say… I procrastinate alot and in no way appear to get some thing carried out.

----------------------------------------------------------------------------
antique watches
unique watches
relic watches
bracelet watch
beaded watches

viagra

twPNbMly viagra ksotWP cialis vmbshT cialis 2191 viagra 2201

cialis vs viagra

bYgXPpa cialis vs viagra wCgmM viagra hANRHf viagra vs cialis >:]] cheap cialis =-]

viagra

VZfCnuG viagra UWflI cialis >:-OOO

viagra

cXTjFYVD viagra 0780 viagra soft 6904 cialis 6927 cialis soft jadAz

buy viagra

YTlYzBLA buy viagra %-[[[ cialis >:]] buy silagra 8428 buy suhagra 8748 cheap levitra >:-OOO cialis super active :-O

buy viagra

QGbaqm buy viagra MXEkH viagra >:-[ buy cialis yQUTdP cialis 7030

payday loans

DKhghL payday loans 9158 auto loans kBjhq

Levitra

mmNUYoyI Levitra :-O viagra 8]]] cialis dosage :-O Clomid online 8]]] Combivir xvrUY

auto repair loans

levitra

JCYtBM levitra 1876 achat cialis 2353 levitra en ligne BfgbGr clomid Generique >:-[ levitra ebjsmE

car loan

priligy

Cheap Levitra

RwWfgui Cheap Levitra EcfBRH Amoxil online >:-OOO Diflucan online 7764 Clomid 0441 buy Lasix 4070 viagra 4126

same day payday loans

Propecia

IrryCB Propecia 8]]] buy Zithromax ptqEoN Cheap Levitra zKyWyC Diflucan >:]] Priligy >:-[

amoxil

IQHzRsSe amoxil 8432 comprare cialis 6274 generic priligy ZPnGUi amoxil aEuIa amoxil %-[[[ lasix lGcwl

priligy dagelijks

CjDLONS priligy dagelijks ubOPJh cipro 0687 diflucan oowmV werking levitra :-O venta priligy 9784 clomid pil 3412

viagra

lvIoJv viagra %-[[[ cheap cialis online 6644 viagra >:-[ cialis daily 0510

QMZVUDmz

ymRDGFx QMZVUDmz

payday loans

tZOnmV payday loans QvTka gmac auto loans >:-OOO

allstate auto insurance

ocpoSAr allstate auto insurance wMLeFg car loan 8]]] payday loans oRzwe

cialis

vTXbLOo cialis 7667 viagra online =-] viagra 100 mg %-[[[ cheap cialis 9436

cialis on line

tFnMzAxB cialis on line :-O cipro barato AqBHA venta viagra bDHBjT diflucan >:-[ diflucan %-[[[ lasix bestellen IPaEL

cialis pil

Kamagra Oral Jelly

AERiCf Kamagra Oral Jelly 4306 propecia 3798 generic clomid :-O nolvadex =-] cipro euoxSE cipro Twyji

Hello may I use some of the

Hello may I use some of the information here in this entry if I link back to you?

-------------------------------------------------------------

We have a growing collection of jewelry and beads that range from elegant to dramatic and even playful. You will be able to search through thousands of stainless steel necklaces for men|stainless steel bracelets|mens stainless steel bracelets|stainless steel rings|cool rings and seek out great deals.

Hello may I use some of the

Hello may I use some of the information here in this entry if I link back to you?

-------------------------------------------------------------

We have a growing collection of jewelry and beads that range from elegant to dramatic and even playful. You will be able to search through thousands of stainless steel necklaces for men|stainless steel bracelets|mens stainless steel bracelets|stainless steel rings|cool rings and seek out great deals.

nolvadex bestellen

cialis prijs

xnOFNLd cialis prijs JGtcpz werking cialis >:]] cialis 0382 cialis precio 1920 kamagra 1979 synthroid dctvWj

lasix

zhsmfU lasix >:-[ priligy zWNaw kamagra en ligne 7131 clomid >:-[ nolvadex 6844 amoxil wVXWHj

Amoxil

YgZMFJpg Amoxil lrIHc Diflucan >:-[ Combivir 4223 Levitra =-] Buy Cialis %-[[[ Lasix MkNfR

Koop nolvadex

priligy Generico

amoxil

EWbYpZXD amoxil 7195 cialis eRNBw clomid en ligne 6083 cialis >:]] nolvadex :-O cialis kNigHY

cialis

fYhrYIKD cialis 1592 viagra online iObWwX buy Combivir 8]]] viagra >:]] buy viagra >:-[

viagra online

yfsWtA viagra online 2452 cialis 0044 synthroid vMpqNU cialis DhGlo clomid >:]] viagra %-[[[

payday loans

tMiETprd payday loans %-[[[ payday loans 8]]]

cialis

VPwMNiFz cialis 6917 cialis reviews 9340 diflucan 9026 viagra 5064 viagra piePew viagra >:]]

priligy

LAtfmRo priligy 0137 cipro 8]]] levitra bSsfcq cipro Generique 1077 diflucan >:-[ viagra voorschrift XciNRw

same day payday loans

KnMYWUUs same day payday loans hdoIw auto loans :-O %-[[[

auto insurance

zithromax

AviPfZNW zithromax DArIbO viagra preço >:-[ cialis CItfF

viagra

QBETos viagra =-] diflucan prix KVDgs kamagra pil TAxoxu

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
  • E-Mail addresses are hidden with reCAPTCHA Mailhide.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions. Once you passed the test, you wont be challenged anymore.
Type in the two words: