Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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

Your Answer


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.