rsync to completely mirror an entire machine

Tony at ServaCorp.com Tony at ServaCorp.com
Sat Feb 4 20:05:24 GMT 2006


Christer Edwards wrote:
> 
> I do apologize if this has been discussed previously.  Looking thru
> some of the archives I wasn't able to clearly answer my question, only
> find bits & pieces.
> 
> Situation:
> I have a web & mail server (production) and a backup machine.  The two
> machines are near identical as far as hardware & software
> installation.  I use the backup machine as a mirror of the main.  If
> for any reason mail functionality dies I can redirect to the mirror,
> etc.
> 
> My question is can I use rsync to safely mirror the entire drive? 
> Currently I have just mirrored /var/www/ & /var/mail/.  I'm sure there
> are other files that may be regularly updates (ie; logs) and I want to
> make sure the backup-mirror is completely up to date.
> 
> Is it safe to just rsync [remote]:/ [local];/ ?  Would the /dev or
> other folders cause issues with this?  Would it be safer to implement
> a more detailed rsync script excluding certain areas?
> 
> I do appreciate the help.
> 

>From past experience (ok, real newbie-like)
even rsyncing everything as a means of cloning a system is survivable.

There's a few things like /proc 
things like pid files in /var/run/
maybe some sockets  that would get in the way
some things in /etc that distinguish the primary from the backup
---a few things you are better off if you don't.

Guessing, you probably want some distinction between the backup running as
backup and the backup running because the primary is dead.

Somebody that actually knows the stuff can probably give you good advice.
What I've seen indicates excellent chances of survivable even without
doing any critical thinking.

Probably the more interesting issue is when the primary fails 
DURING the backup. (and you really need the backup you just destroyed).



More information about the rsync mailing list