[svlug] maintaining synchronicity among files on Linux farm

Christopher Lee clee at gnwy100.wuh.wustl.edu
Fri Apr 20 10:54:02 PDT 2001


>>>>> "Chris" == Chris Paul <ChrisP at Atoga.com> writes:


    Chris> I think a simple shell script with rcp's would be fine except I
    Chris> don't want .rhost (or hosts.equiv) set for root.


I use use ssh + rsync in a script.  Start by using ssh-agent to enter
your root passphrase, then execute your script.  In python it would look
something like (untested!):

for host in hosts:
    for file in files:
	src = file
	dest = host + ":" + file
	out, in, err = os.popen3("rsync -az -e ssh %s %s" % (src,dest))
	

Where "hosts" and "files" contain the list of host names and files you want
to keep synchronized.  You could write out errors to a log file & also
might want to add automatic backups of the old files.  (I'm assuming
that this is easy enough to translate into another scripting language.)

all the best,

-chris

-- 
Christopher Lee
Washington University Dept. of Anatomy and Neurobiology




More information about the svlug mailing list