【linux命令】rsync断点续传

rsync断点续传

1. 断点续传命令:

rsync -P --rsh=ssh /root/test 172.10.33.87:/root/test

 

需求:主机A传送文件夹TestDB到主机B,实验rsync断点续传的过程记录:

[oracle@rac1-server TestDB]$ rsync -rP --rsh=ssh /home/oracle/TestDB/ oracle@192.168.1.173:/home/oracle/TestDB
sending incremental file list
created directory /home/oracle/TestDB
./
DB1.dbf
     4194304 100%   17.88MB/s    0:00:00 (xfer#1, to-check=7/9)
DB2.dbf
    41959424 100%   13.41MB/s    0:00:02 (xfer#2, to-check=6/9)
DB3.dbf
     8380416 100%    5.57MB/s    0:00:01 (xfer#3, to-check=5/9)
DB4.dbf
    41959424 100%    6.64MB/s    0:00:06 (xfer#4, to-check=4/9)
DB5.dbf
    76021760 100%   12.90MB/s    0:00:05 (xfer#5, to-check=3/9)
DB6.dbf
    80347136  79%    9.76MB/s    0:00:02
--此处断开了连接
Last login: Tue Jul  1 09:22:34 2014 from 192.168.1.101
[oracle@rac1-server ~]$ rsync -rP --rsh=ssh /home/oracle/TestDB/ oracle@192.168.1.173:/home/oracle/TestDB
sending incremental file list
DB1.dbf
     4194304 100%  102.51MB/s    0:00:00 (xfer#1, to-check=7/9)
DB2.dbf
    41959424 100%   64.44MB/s    0:00:00 (xfer#2, to-check=6/9)
DB3.dbf
     8380416 100%   11.38MB/s    0:00:00 (xfer#3, to-check=5/9)
DB4.dbf
    41959424 100%   37.40MB/s    0:00:01 (xfer#4, to-check=4/9)
DB5.dbf
    76021760 100%   47.14MB/s    0:00:01 (xfer#5, to-check=3/9)
DB6.dbf
   100597760 100%   42.85MB/s    0:00:02 (xfer#6, to-check=2/9)
DB7.dbf
  1005977600 100%   10.95MB/s    0:01:27 (xfer#7, to-check=1/9)
DB8.dbf
   182517760 100%    9.85MB/s    0:00:17 (xfer#8, to-check=0/9)

sent 1188790859 bytes  received 248537 bytes  10760537.52 bytes/sec
total size is 1461608448  speedup is 1.23
[oracle@rac1-server ~]$
--实现了断点续传

将远程机器的目录拷贝到本机器上:

rsync -rP --rsh=ssh 175.24.181.254:/root/appstream /root

 

posted @ 2021-11-24 22:56  苏格拉底的落泪  阅读(260)  评论(0编辑  收藏  举报