Linux 主機之間即時傳送文件,scp命令你們都很熟悉
但當要傳送的文件較大,過程當中若是網絡中斷了,就比較悲劇了。這時候能夠考慮使用rsync命令替代scp,實現斷點續傳文件。html
試驗:rsync使用sql
環境:2臺RHEL 5.7網絡
需求:主機A傳送文件夾TestDB到主機Boracle
1
|
rsync -rP
--rsh=ssh /home/oracle/TestDB/ oracle@192.168.1.173:/home/oracle/TestDB
|
實驗rsync斷點續傳的過程記錄:ssh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
[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 ~]$
--實現了斷點續傳
|