Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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