linux 主機之間即時傳送檔案,scp命令大家都很熟悉
但當要傳送的檔案較大,過程中如果網路中斷了,就比較悲劇了。這時候可以考慮使用rsync命令替代scp,實現斷點續傳檔案。
試驗:rsync使用
環境:2臺rhel 5.7
需求:主機a傳送資料夾testdb到主機b
rsync -rp
--rsh=ssh /home/oracle/testdb/ [email protected]:/home/oracle/testdb
實驗rsync斷點續傳的過程記錄:
[oracle@rac1-server testdb]$ rsync -rp
--rsh=ssh /home/oracle/testdb/ [email protected]:/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/ [email protected]:/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 ~]$
--實現了斷點續傳
http range實現斷點續傳(斷點續載)
使用http range實現斷點續傳 伺服器端 響應的格式是 記錄檔案大小 long pastlength 0 int rangeswitch 0 long tolength 0 long contentlength 0 客戶端請求的位元組總量 string rangebytes 記錄客戶端傳來的形...
用HttpListener實現檔案斷點續傳
普通方式請求伺服器上的乙個文時,所發出的請求和接受到的伺服器如下 request header cache control no cache connection close pragma no cache accept host localhost response header 當伺服器支援斷點...
scrapy 斷點續爬
第一步 安裝berkeleydb資料庫 第二部 pip install bsddb3 第三部 pip install scrapy deltafetch 第四部 settings.py設定 spider middlewares deltafetch enabled true deltafetch e...