rsync: synch both boot and data volumes.

If you have mission critical servers, you know that a backup is essential. I do not want my mission critical web server to go down. Along comes rsync.

How to set up rsync to synch my boot drive (and make it bootable) as well as synch my data files (html/php files):
First, you will to set up passwordless ssh between your servers. This is a good tutorial, except make sure step #5 is actually: /var/root/.ssh/cat >> authorized_keys2 . Now you are ready to send data from your main server to the backup(s).

I have a daily cron job to run my data rsync script.
The script is: time sudo rsync -a -vv -z -e ssh "/Volumes/www" "[email protected]:/Volumes".
(where /Volumes/www is the location of all my data files and is the IP of my backup web server)

Boot drive (that is bootable)
I have a weekly (I chose weekly because if I apply an update to something that proves not to work, I know I have some flexibility) (and yes I always apply updates to a test server first) cron job to run my boot script.
The script is:time sudo rsync -a --exclude /dev/* --exclude /afs/* --exclude /private/tmp/* --exclude /Network/* --exclude /Volumes/* --exclude /automount/* --exclude /private/var/run/* -vv -e ssh "/." [email protected]:/Volumes/BackUp --delete ; sudo rsync -qe ssh'`sudo bless -folder /Volumes/BackUp/System/Library/CoreServices`' .
(where /Volumes/BackUp is the location of all my boot(System) files and is the IP of my backup web server)

Next up: IP Failover! (another day)

Using rsync really cuts down on my worry..well a little, and also helps me keep all my servers synched to the primary server. Enjoy, it is time we started making these servers work for us, not the other way around!

About the Author...

Jennifer Zelazny

My name is Jennifer Zelazny and this site is a collection of my random thoughts and opinions. I am Penn Stater, WordPress developer, and a modern day explorer. I love exploring data, trends, and things that make the world a better place and sharing them here.

Leave a Reply

Your email address will not be published.
You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>