Write the script that does this:
#! /bin/sh -
for server do
ssh "$user@$server" < Sourcefile '
cat > directory/TargetFile && /etc/init.d/daemon restart'
And then you can pass the list of servers as you like such as
xargs < servers.txt your-script root
I tried your script first because you'd added formatting - so I could read it easily - and it
worked so points to you !
1)create a file and insert IP of all remote hosts(IP_OF_REMOTE_HOSTS)
2)connect to the following link and learn how to use scp without passwd http://linuxproblem.org/art_9.html
3) for $IP in `cat IP_OF_REMOTE_HOSTS
#............put your scp here
scp SourceFile user@$IP:directory/TargetFile
ssh user@$IP /etc/init.d/daemon restart
You can start service RSH
and after you can update XML file from all server
you must vi /etc/rhosts or /etc/host.equiv
and add IP Host-Name
cat new.xml |rsh server2 >/tmp/old.xml