scp a single file to multiple locations

Let's say you have a file (destfile.txt) with user@host-values, one on each line. Then you could do like this:

while IFS= read -r dest; do
  scp ourfile.txt "$dest:remote/path/"
done <destfile.txt

Looks like a job for parallel-scp(n)(t) - this implements a set of commands that allow for scp commands to be run on multiple systems at once. It will allow for the copying of files in parallel to a set of machines.


cat file.txt | tee >(ssh [email protected] "cat > file.txt") \
                   >(ssh [email protected] "cat > file.txt")

tar cz file1 file2 file3 | tee >(ssh [email protected] "tar xz") \
                               >( ... )