SCP 断点续传!

工作中,总是经常需要传输文件,有很多工具非常好用,scp、sftp等。可是这些工具没有断点续传的功能,一旦网络中断,所传的文件都白费了,还得重新传输。下面我用rsync来完成断点续传。注意下面要传的文件一定要和之前的文件一样,而且拷贝到某个主机的目录也要一致。下面是我的一个例子。

[root@johnny]# rsync -avzP file root@172.20.7.219:/root/tmp           (我这里file指要传送的文件)

Password:
building file list ...
1 file to consider
file                                                          746602496 100%  324.23kB/s    0:37:28 (xfer#1, to-check=0/1)

sent 127779788 bytes  received 170765 bytes  56279.11 bytes/sec

total size is 746602496  speedup is 5.84


 参数说明:     

  v:详细提示 

  a:以archive模式操作,复制目录、符号连接,等价于 -rlptgoD 。 

  z:压缩 

  u:只进行更新,防止本地新文件被重写,注意两者机器的时钟的同时 

  P:是综合了--partial --progress两个参数

机房之间传文件一般都担心带宽占用太多,特别是在共用带宽的情况下。常用的两个软件都可以限速: 

scp可以加上 -l 参数: 

 

引用 

     -l limit 

             Limits the used bandwidth, specified in Kbit/s. 

rsync可以加上 --bwlimit 参数 

 

引用 

        -i, --itemize-changes       output a change-summary for all updates 

            --log-format=FORMAT     output filenames using the specified format 

            --password-file=FILE    read password from FILE 

            --list-only             list the files instead of copying them 

            --bwlimit=KBPS          limit I/O bandwidth; KBytes per second 

            --write-batch=FILE      write a batched update to FILE 

            --only-write-batch=FILE like --write-batch but w/o updating dest


  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值