13

I have a file I want to sent to multiple separate servers. Is it possible to name multiple destinations?

rsync foo.png server1:foo.png server2:foo.png

This gives me a "Unexpected remote arg:server1:foo.png

3 Answers 3

15

Turns out there is a program that permits this, just not the original rsync program. It's called pssh (parallel ssh I suppose)

One of the features:

"-- Parallel rsync (parallel-rsync, upstream calls it prsync), efficiently copies files to multiple hosts in parallel"
- http://www.ubuntugeek.com/execute-commands-simultaneously-on-multiple-servers-using-psshcluster-sshmultixterm.html

9

No, there is no way in rsync to specify multiple destinations. You'll need to invoke the command multiple times. If you have many targets, you might want to consider using a network filesystem instead--it might be a better fit for your problem.

0

Albeit you're invoking the command multiple times through file input, this can be done by specifying the desired destinations in one desired file:

while read in; do rsync -av /Path/of/Source/Synced.file "$in":/Path/of/Destination/Synced.file; done < destinations.txt

enter image description here

Please excuse my test as I only had two systems available at the time, but I'm most certain this will work for multiple systems as desired. It's not the most elegant method I suppose, but it's definitely one way of automating. And please, feel free to correct me if this doesn't work as I don't have the resources available to test beyond two systems at this time of post.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .