[CentOS] Best way to duplicate a live Centos 5 server?

Tue Jul 10 17:26:39 UTC 2012
Les Mikesell <lesmikesell at gmail.com>

On Tue, Jul 10, 2012 at 1:36 AM, Emmanuel Noobadmin
<centos.admin at gmail.com> wrote:
> On 7/9/12, Les Mikesell <lesmikesell at gmail.com> wrote:
>> One thing that helps is to break it up into separate runs, at least
>> per-filesystem and perhaps some of the larger subdirectories.
>> Depending on the circumstances, you might be able to do an initial run
>> ahead of time when speed doesn't matter so much, then just before the
>> cutover shut down the services that will be changing files and
>> databases and do a final rsync which will go much faster.
>
> I did try this but the time taken is pretty similar in the main delay
> is the part where rsync goes through all the files and spend a few
> hours trying to figure out what needs to be the updated on the second
> run after I shutdown the services. In hindsight, I might had been able
> to speed up things up considerably if I had generated a file list
> based on last modified time and passed it to rsync via the
> exclude/include parameters.

Hours?  This should happen in the time it takes to transfer a
directory listing and read through it unless you used --ignore-times
in the arguments.  If you have many millions of files or not enough
RAM to hold the list I suppose it could take hours.

>> Also, have you looked at clonezilla and ReaR?
>
> Yes, but due to time constraints, I figured it was safer to go with
> something simpler that I didn't have to learn as I go and could be
> done live without needed extra hardware on site. Plus it would be
> something that works at any site I needed it without extra software
> too.

Rear 'might' be quick and easy.  It is intended to be almost
unattended and do everything for you.  As for extra software - it is a
'yum install' from EPEL.   The down side is that if it doesn't work,
it isn't very well documented to help figure out how to fix it.    I'd
still recommend looking at it as a backup/restore solution with an
option to clone.  With a minimum amount of fiddling you can get it to
generate a boot iso image that will re-create the source filesystem
layout and bring up the network.  Then, if you didn't want to let it
handle the backup/restore part you could manually rsync to it from the
live system.

-- 
   Les Mikesell
      lesmikesell at gmail.com