How can I use PDSH and SCP to transfer file to my servers (over 200 of them coming from a text file - ips)

Also how can I automate this? Have people written scripts for this? Examples?

link|improve this question

56% accept rate
feedback

1 Answer

If you mean parallel-ssh (apt-get install pssh on Debian), you can do this quite simply this way.

parallel-scp -h ips localfile /remote/path/file

If you meant pdcp, which is part of the pdsh package, I would pass on it - I just gave it a try and it would seem it requires pdcp to be present on the remote host, unlike parallel-scp. So I would stick to the former if you can - but if you must you can try this:

hosts=`cat ips | tr '\n' ','`
pdcp -R ssh -w $hosts localfile remotefile

This assumes ips has a host per line. It reads it and replaces the newlines by commas, thus creating a list in the format expected by pdcp. You can skip this step if you already have a comma-separated list of course.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.