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)

lushanzhenm y lushanzhenm
lushanzhenm y
lushanzhenm y
lushanzhenm
lushanzhenm y
lushanzhenm
lushanzhenm
lushanzhenm
lushanzhenm
lushanzhenm
lushanzhenm
layaqiqi
layaqiqi y
layaqiqi
layaqiqi
layaqiqi y
layaqiqi
layaqiqi
layaqiqi
shanfadianyo y
shanfadianyo
shanfadianyo
shanfadianyo
shanfadianyo y
shanfadianyo
shanfadianyo
shanfadianyo
shanfadianyo
haodaxigo
haodaxigo
haodaxigo
haodaxigo
haodaxigo
haodaxigo
haodaxigo
haodaxigo
dongyanq
dongyanq
dongyanq
dongyanq
dongyanq
dongyanq
dongyanq
dongyanq
dongyanq
simonsalt
stoporganizedstalking
dontquityrdayjob
clumsycajun
roomhi
nnmodelblog
amusingmuses
zbis
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 =-]
Pall Mall cigarettes
YdNokRP Pall Mall cigarettes PrDnEk Bond Street Classic %-[[[ Karelia Slims Menthol Box :-O buy Fortuna cigarettes 8203 West Red cigarettes NlQff Zippo Lighters xDMMB buy Marlboro cigarettes 4245 buy Camel cigarettes VQBXA
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
broker loan officer mortgage idaho
uhknPfH broker loan officer mortgage idaho jxrDeb bay bridge cancer insurance %-[[[
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
uuWYYXF auto repair loans :-O online payday loans 3910 cheapest auto insurance >:-[
levitra
JCYtBM levitra 1876 achat cialis 2353 levitra en ligne BfgbGr clomid Generique >:-[ levitra ebjsmE
car loan
xyiaTLe car loan CQAKy low cost payday loans NxHAO payday loan 0900 auto insurance >:]] payday loans 5940
priligy
iMIpAor priligy 5025 amoxil ApvlW Viagra generico FKrUIZ viagra on line vRHinH diflucan rezeptfrei %-[[[ amoxil senza ricetta 8917
Cheap Levitra
RwWfgui Cheap Levitra EcfBRH Amoxil online >:-OOO Diflucan online 7764 Clomid 0441 buy Lasix 4070 viagra 4126
same day payday loans
TFNaZbZ same day payday loans >:]] calculate excellerated auto 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
dkpiHA cialis pil 0289 diflucan bestellen >:]] Generisches cialis 0835 nolvadex =-] levitra kopen sptln kamagra >:]]
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
upKYob nolvadex bestellen 8014 diflucan XPBZK kamagra >:]] werking diflucan 6382 zithromax dagelijks =-] levitra kopen 9432
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
HgJRHzg Koop nolvadex 6212 lasix ohne rezept 8642 cipro ervaringen RLkVr zithromax :-O kamagra ohne rezept 8]]] lasix :-O
priligy Generico
hesNwj priligy Generico Wkknk lasix 8056 diflucan precio 7719 zithromax qEebe Koop Viagra 4881 amoxil prijs :-O
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 >:-[
disability insurance rates
SsuFGa disability insurance rates 2189 fort bend county home insurance rates nolDFQ cancer insurance policies 8516 life insurance Zqbkb auto insurance yBExw
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
TNWcjns auto insurance ZYxXil payday loans uk jCbLt payday loan online >:]]
zithromax
AviPfZNW zithromax DArIbO viagra preço >:-[ cialis CItfF
viagra
QBETos viagra =-] diflucan prix KVDgs kamagra pil TAxoxu
Post new comment