[vox-tech] rsync as an installation / update tool

Jonathan Stickel vox-tech@lists.lugod.org
Tue, 30 Mar 2004 11:10:38 -0800


First, let me rave about rsync.  It is easy to use, very fast, and can 
be used directly with ssh, another favorite tool of mine.  I first 
started to use it to back up my laptop's home directory onto a desktop, 
like this:

$rsync -vax -e ssh --exclude=mnt/ --exclude=some_file --delete-excluded 
/home username@desktop:/path_to_backup_folder

I put this one line in a script for ease of use.  If many exclusions are 
desired, a list can be put in a text file to be read by rsync.

This week I got a wild idea to use rsync as a means of "installing" and 
"updating" gentoo linux on computers with similar (but not identical) 
hardware.  I have 4 Pentium3 boxes that I use for engineering 
simulations.  I had installed gentoo linux on one computer a couple 
months ago, but the others had RedHat 9.  I love gentoo, but I didn't 
want to spend hours converting them all if I could avoid it.  So my idea 
was to wipe redhat, re-partition the drive (if necessary), install the 
_basic_ stage3 gentoo install using the "livecd", and rsync over 
everything else from the computer with gentoo already installed.  Here 
is the rsync command I used:

#rsync -va -e ssh --exclude-from=exclude_file --delete-after 
root@gentoo_computer:/ /

exclude_file
------------
dev/
home/
mnt/
proc/
root/
sys/
etc/fstab
etc/X11/XF86Config
etc/hostname
etc/hosts
etc/conf.d/net
boot/grub/grub.conf

Since I have different video cards and different partition schemes, I 
have to configure XF86Config, fstab, and grub.conf manually.  But almost 
everything else copies over and works automatically, such as firewall, 
ntp, and logrotate settings.  Now I just need to download and compile 
updates for one computer, and then use the same rsync command to update 
the other 3.

So far, I have been successful with one computer and am waiting to see 
if any bugs appear before doing the other 2.  Any comments?  Are there 
any potential pitfalls to maintaining computers this way?

Regards,
Jonathan