Linux命令:rsync和scp相关

复制移动(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
发布了37 篇原创文章 · 获赞 2 · 访问量 7616

猜你喜欢

转载自blog.csdn.net/bingozb/article/details/99882376