复制移动(rsync and scp)
rsync
一、复制移动文件
rsync -Pharv xxx(file or file folder) remote_user@remote_host:/path
二、远程复制移动文件,指定端口号
rsync -e "ssh -p 18022" -Pharv xxx(file or file folder) remote_user@remote_host:/path
三、根据文件list将批量文件从一台机器迁移到另一台
rsync -Pharv ${remote_user}@${remote_host}:${remote_list} ${local_list} #将远程机器的list拉到本地
rsync -Pharv --files-from ${local_list} ${remote_user}@${remote_host}:/ ${local_output_dir} #依据list,将文件复制至本地机器
scp
scp -r xxx(file or file folder) remote_user@remote_host:/path