tar + ssh传输文件
(引用)[https://serverfault.com/questions/326490/running-multiple-scp-threads-simultaneously]
I would do it like this:tar -cf - /manyfiles | ssh dest.server 'tar -xf - -C /manyfiles'
Depending on the files you are transferring it can make sense to enable compression in the tar
commands:tar -czf - /manyfiles | ssh dest.server 'tar -xzf - -C /manyfiles'
It may also make sense that you choose a CPU friendlier cipher for the ssh
command (like arcfour):tar -cf - /manyfiles | ssh -c arcfour dest.server 'tar -xf - -C /manyfiles'
Or combine both of them, but it really depends on what your bottleneck is.
Obviously rsync
will be a lot faster if you are doing incremental syncs.
expect 捕捉ssh自动输入
sudo yum install -y expect |
- 批量ssh公钥往目标机上传
!/usr/bin/expect -f |
!/bin/bash |