-a | 以存档的模式保存原有文件的所有属性信息 |
-p | |
-r |
which mv | 查询命令的绝对路径 |
rpm -qf /bin/mv | 查询命令的安装包 |
rpm -qi coreutils | 查询软件包的详细信息 |
-F ssh_config | 指定登录读取的配置文件 |
-l limit | |
-P port | |
保留相关属性 | |
1
2
|
$
scp
-l 1000 -P 36000 root@10.210.170.199:
/jetty/webapps/test
.war
/home/redhat
test
.war 100% 2231KB 131.2KB
/s
00:17
|
-x | |
-r | 按照递归的方法下载服务器上所有的目录与文件 |
-m | 制作镜像站点 |
-c | |
-i | |
-m | |
| |
-N | 不要下载已经存在的文件 |
1
2
|
# wget -c -t 2 -w 30 ftp://username:password@22.11.33.195/aa.txt
# wget -N http://xxx.com/data/aa.txt -o cc.txt -a dd.log &
|
-a | 以归档模式传输 |
-v | 显示详细信息 |
-z | 传输过程对数据进行压缩 |
-n | 试运行,会预览每个文件操作 |
--progress | 显示进度条 |
--bwlimit | 设置传输速率 |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
# vim /etc/rsyncd.conf
# Section 1: Global settings
uid = nobody
gid = nobody
use chroot = no
max connections = 5
#限制模块最大并发连接数,默认值为0即无限制
strict modes =
yes
#设置是否检查口令文件的权限,yes则要求密码文件权限为root权限
pid
file
=
/var/run/rsyncd
.pid
lock
file
=
/var/run/rsync
.lock
log
file
=
/var/log/rsyncd
.log
# Section 2:Directory to be synced
[web]
#定义一个模块的开始(模块名称)
path =
/www/web
ignore errors =
yes
read
only = no
#客户端可以上传文件
write only = no
#客户端可以下载文件
hosts allow = 172.16.0.0
/16
hosts deny = *
list =
false
#是否列出客户请求时的模块列表。默认为ture (这里设置隐藏模块)
uid = root
gid = root
auth
users
= xkun
#设置用于连接的用户名,多个之间通过空格和逗号隔开
secrets
file
=
/etc/server
.pass
|
1
2
3
|
# vim /etc/server.pass
xkun:redhat
# chmod 600 /etc/server.pass
|
1
|
# man rsyncd.conf
|
1
2
|
# /usr/local/bin/rsync --daemon
# ps -ef | grep rsync
|
1
2
3
4
5
6
|
# vim /etc/client.pass
redhat
# chmod 600 /etc/client.pass
# /usr/local/bin/rsync -avz --progress
--delete xkun@172.16.21.1::web
/web
.net \
--password-
file
=
/etc/client
.pass
|