linux下目录传输多种方法及测试(debian)

简介:
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
我的博客已迁移到xdoujiang.com请去那边和我交流
基础环境说明及安装
1、服务器
serverA=192.168.1.124(debian7.8)
serverB=192.168.1.122(debian6.0.10)
 
2、需要将serverB下的目录testtransfer(4.5G)下全部远程复制到serverA下
 
3、需要用到软件
1)apt-cache search pigz
pigz - Parallel Implementation of GZip(多线程压缩)
2)apt-cache search pv | grep  "^pv"
pv - Shell pipeline element to meter data passing through
3)apt-cache search netcat
netcat - TCP /IP  swiss army knife -- transitional package
4)apt-get -y  install  pigz
5)apt-get -y  install  pv
6)apt-get -y  install  netcat
7)apt-get -y  install  wget
8)apt-get -y  install  rsync
9)apt-get -y  install  vsftpd
10)apt-get -y  install  lftp
11)apt-get -y  install  python
 
一、 ssh + tar + gzip (pigz)
1、使用 ssh + tar + gzip 方式( ssh 协议)在(serverB)上
time  tar  czf - testtransfer/| ssh  -q jimmy@192.168.1.124  "tar zxf - -C /tmp"
real    13m20.771s
user    4m43.186s
sys     1m55.239s
 
2、使用 ssh + tar +pigz方式( ssh 协议)在(serverB)上
time  tar  cf - testtransfer/|pigz| ssh  -q jimmy@192.168.1.124  "pigz -d|tar xf - -C /tmp"
real    12m7.335s
user    4m12.200s
sys     1m46.455s
 
参数说明
-d, --decompress     Decompress the compressed input
 
二、nc+ tar + gzip (pigz)
1、使用nc+ tar + gzip 方式(tcp协议)
nc -lp 55555| tar  -zxf - -C  /tmp (serverA)
time  tar  -zcf - testtransfer/|pv|nc -w 1 192.168.1.124 55555(serverB)
real    11m31.341s
user    4m25.589s
sys     1m35.162s
 
2、使用nc+ tar +pigz方式(tcp协议)
nc -lp 55555|pigz -d| tar  xf - -C  /tmp (serverA)
time  tar  -cf - testtransfer/|pigz|pv|nc -w 1 192.168.1.124 55555(serverB)
real    10m42.789s
user    4m9.968s
sys     1m6.860s
 
参数说明
-w secs   timeout  for  connects and final net reads
 
三、python或web服务器
1、python web服务在(serverB)上
nohup  python -m SimpleHTTPServer 50000 &
2、在(serverA)上使用wget去下载
wget -r -q 192.168.1.122:50000
real    4m35.531s
user    0m0.360s
sys     0m33.218s
 
参数说明
-m module-name Searches sys.path  for  the named module and runs the 
corresponding .py  file  as a script.
 
四、 rsync ( rsync 协议)
1、服务端配置(serverB)
1)配置rsyncd.conf
cat  rsyncd.conf 
[aaa]
     path =  /opt/testtransfer
     use chroot =  yes
     read  only =  yes
     uid = jimmy
     gid = jimmy
     auth  users  = www-data
     secrets  file  /etc/rsyncd .secrets
2)配置验证密码
cat  /etc/rsyncd .secrets
www-data:123456
3)权限
chmod  600  /etc/rsyncd .secrets
 
2、客户端配置(serverA)
1)配置密码
cat  /etc/rsyncd .secrets
123456
2)开始传输
time  rsync  -az --password- file = /etc/rsyncd .secrets www-data@192.168.1.122::aaa  /opt/111
real    9m46.331s
user    0m5.600s
sys     1m0.448s
 
参数说明
-a, --archive  This  is equivalent to -rlptgoD. 
-z, --compress With  this  option,  rsync  compresses the  file  data as it is 
sent to the destination machine,  which  reduces the amount of data being 
transmitted -- something that is useful over a slow connection.
 
五、 ftp ( ftp 协议)
1、服务端配置(serverB)
1)配置vsftpd.conf
cat  /etc/vsftpd .conf
listen=YES
local_enable=YES
pam_service_name=vsftpd
 
2、客户端配置(serverA)
time  lftp jimmy:redhat@192.168.1.122 -e  "mirror /opt/testtransfer;quit"
real    7m29.727s
user    0m1.252s
sys     0m46.495s
 
PS:serverB上的jimmy用户建立过的,密码是redhat









本文转自 xdoujiang 51CTO博客,原文链接:http://blog.51cto.com/7938217/1656687,如需转载请自行联系原作者
目录
相关文章
|
1天前
|
XML 存储 测试技术
深入理解自动化测试中的数据驱动方法
【5月更文挑战第11天】 在软件测试领域,数据驱动测试(DDT)是一种高效的测试策略,它允许测试人员通过外部数据源控制测试用例的输入和输出。这种方法促进了测试用例的参数化,并提高了测试的灵活性和可维护性。本文将探讨数据驱动测试的核心概念、实施步骤以及使用Python进行数据驱动测试的实践案例,旨在为读者提供一种结构化的方法来设计和执行复杂的测试场景。
|
1天前
|
安全 数据可视化 前端开发
【测试开发】用例篇 · 熟悉黑盒测试用例设计方法(2)· 正交表 · 场景设计 · 常见案例练习
【测试开发】用例篇 · 熟悉黑盒测试用例设计方法(2)· 正交表 · 场景设计 · 常见案例练习
5 0
|
1天前
|
人工智能 测试技术 数据处理
【测试开发】用例篇 · 熟悉黑盒测试用例设计方法(1)等价类划分法、边界值法、判定表法
【测试开发】用例篇 · 熟悉黑盒测试用例设计方法(1)等价类划分法、边界值法、判定表法
5 0
|
1天前
|
Ubuntu Linux Shell
mc实现目录同步并封装成Linux服务形式
mc实现目录同步并封装成Linux服务形式
11 1
|
1天前
探讨AC/DC电源模块的可靠性设计和测试方法
探讨AC/DC电源模块的可靠性设计和测试方法
探讨AC/DC电源模块的可靠性设计和测试方法
|
1天前
BOSHIDA AC/DC电源模块的可靠性设计与测试方法
BOSHIDA AC/DC电源模块的可靠性设计与测试方法
BOSHIDA  AC/DC电源模块的可靠性设计与测试方法
|
1天前
|
测试技术
使用 Playwright 复用 Cookie:简化自动化测试的高效方法
Playwright 提供的 Cookie 复用功能允许在不同测试用例间共享会话状态,提高测试效率。通过 `context.set_cookies()` 方法设置共享 Cookie 数据,确保会话在多个测试中保持一致。优点包括节省时间、维持稳定会话,但需注意可能增加测试用例间的依赖。使用此功能可优化自动化测试流程。
6 1
|
1天前
|
Linux 测试技术 Windows
LabVIEW对NI Linux RT应用程序性能进行基准测试
LabVIEW对NI Linux RT应用程序性能进行基准测试
|
1天前
|
Linux Shell
Linux操作系统下查找大文件或目录的技巧
Linux操作系统下查找大文件或目录的技巧
11 2
|
1天前
|
消息中间件 测试技术 Linux
linux实时操作系统xenomai x86平台基准测试(benchmark)
本文是关于Xenomai实时操作系统的基准测试,旨在评估其在低端x86平台上的性能。测试模仿了VxWorks的方法,关注CPU结构、指令集等因素对系统服务耗时的影响。测试项目包括信号量、互斥量、消息队列、任务切换等,通过比较操作前后的时戳来测量耗时,并排除中断和上下文切换的干扰。测试结果显示了各项操作的最小、平均和最大耗时,为程序优化提供参考。注意,所有数据基于特定硬件环境,测试用例使用Alchemy API编写。
21 0
linux实时操作系统xenomai x86平台基准测试(benchmark)

热门文章

最新文章