Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations MikeeOK on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to copy a single file onto multiple machines

Status
Not open for further replies.

archit

Programmer
Aug 22, 2002
19
US
Hi all ,
I want to copy a file onto multiple linux and solaris machines. It should take the list of host m/c from a file which have the same root password.

I am totally new to scripting any help will be welcome.

rgds
Vikul
 
create your listof_remote_machines.file
from /etc/hosts however you like.
(List will look like 145.300.4.34 rem_machine1 )
then do :
FILE_TOCOPY=your_file
REMDIR=dir_name_on_remote_machine
while read A B
do
rcp $FILE_TOCOPY ${B}:${REMDIR}
done < list_of_remote_machines.file

HTH Dickie Bird (:)-)))
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top