A script for remote replication
There is a requirement that there are N servers, each with a different port.
For example, 1.1.1.1purl 22
2.2.2.2:33
3.3.3.3:55
……
All servers are made secret-free login.
First, write a file to write the ip and the corresponding port, such as: vim scp.log1.1.1.1:222.2.2.2:333.3.3.3:55. Vim scp.shroudanbinandbashhands authorizationgyu (Email:348450594@qq.com) # this is a scp.shwhile read line do for i in $line do touch / tmp/scp.txt echo $I > / tmp/scp.txt Scp / tmp/a.txt-P `awk-F:'{print $NF}'/ tmp/ scp.txt` root@ `awk-F:'{print $1}'/ tmp/ scp.txt`: / tmp/ echo > / tmp/scp.txt done done < / tmp/scp.log