- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: copy files on many hosts
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2006 09:28 AM
10-06-2006 09:28 AM
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2006 09:44 AM
10-06-2006 09:44 AM
SolutionIf so do something like this:
1) Create a file with the names of the other 49 servers.
# cat server_list
server1
server2
server3
2) Create a script that will read server_list and ftp your file to them.
#!/usr/bin/sh
SOURCE=/dir/sourc/file
DESTDIR=/dir/dest
DESTFILE=file1
for NAME in $(cat server_list)
do
ftp -inv ${NAME} << EOF
user oper password
bin
cd ${DESTDIR}
put ${SOURCE} ${DESTFILE}
bye
EOF
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2006 09:46 AM
10-06-2006 09:46 AM
Re: copy files on many hosts
#!/usr/bin/sh
HOSTS="mickey minnie donald pluto"
for HOST in ${HOSTS}
do
ftpput.pl -h ${HOST} -l oper -p secret -B -d /xxx/yyy myfile
STAT=${?}
if [[ ${STAT} -eq 0 ]]
then
echo "Transfer to ${HOST} ok."
else
echo "Transfer to ${HOST} failed; status ${STAT}" >&2
fi
done
---------------------------------------
If you will create a .netrc file on your local box then there is no ned for the -p password. Invoke the attached script as "ftpput.pl -u" for full usage.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2006 10:19 AM
10-06-2006 10:19 AM
Re: copy files on many hosts
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2006 10:23 AM
10-06-2006 10:23 AM
Re: copy files on many hosts
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-06-2006 11:43 AM
10-06-2006 11:43 AM
Re: copy files on many hosts
Logon to server1 and in oper's $HOME create a .netrc file with format:
machine server2 login oper password mypass
machine server3 login oper password mypass
machine server4 login oper password mypass
machine server49 login oper password mypass
after you create the file run "chmod 400 .netrc
Create a script:
#/usr/bin/ksh
for svr in `cat $HOME/.netrc|awk '{print $2}'`
do
rexec $svr ls -l
done
exit
Note: you only need to create .netrc on server1 and you can only run rexec from server1
with the same .netrc, when you run ftp to the other 49 servers, system will not ask you for the password.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2006 06:53 PM
10-08-2006 06:53 PM
Re: copy files on many hosts
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-08-2006 07:52 PM
10-08-2006 07:52 PM
Re: copy files on many hosts
Firstly no passwords for authorization are transmitted in clear.
Secondly the whole data transfer is also encrypted.
This of course comes at a price of a little overhead which should reduce the throughput compared to the r* commands.
Besides, the usage is very similar to remsh.