简述Linux如何远程拷贝,限速和断点续传
scp 拷贝本地文件filename 到远程机器 192.168.188.188 服务器的/data/tmp目录下
scp -P 61204 -l 40000 filename username@192.168.188.188:/data/tmp/
Specifies the port to connect to on the remote host. Note that this option is written with a capital ‘P’, because -p is already reserved for preserving the times and modes of the file in rcp(1).
注:scp不支持断点续传
#rsync同步本地文件 filename 到远程机器 192.168.188.188 服务器的/data/tmp目录下
rsync -avzP -e 'ssh -p 61204' --bwlimit=5000 filename username@10.20.90.101:/data/tmp/ >> scp_to_101.log
如果在拷贝文件的过程中,传输被中断,rsync的默认操作是撤消前操作,即从目标机上删除已拷贝的部分文件。
如果想在下次拷贝时续传文件,不需要重新拷贝所有文件的话,可以使用-partial选项阻止rsync在传输中断时删除已拷贝的部分
ssh -p 61204
指定ssh的端口(非默认22)61204
上例:使用rsync传输本地文件filename到192.168.188.188的/data/tmp目录下 使用压缩归档传输、限速5MB、支持断点续传 使用ssh协议
详情 可以参考 man scp 和man rsync 手册
原文来自:https://www.linuxidc.com/Linux/2016-05/131116.htm
本文地址:https://www.linuxprobe.com/linux-scp-rsync.html编辑:黑曜羽,审核员:逄增宝
Linux命令大全:https://www.linuxcool.com/
Linux系统大全:https://www.linuxdown.com/
红帽认证RHCE考试心得:https://www.rhce.net/