测试环境
1.1服务器硬件信息
1.2 服务器软件信息
1.3 Rsync所能够支持的功能
(1)支持断点续传
(2)支持使用ssh传输加密
(3)支持128位MD4校验(3.0以后版本使用MD5加密)
(4)支持镜像
(5)支持限速
(6)支持目录层级递归拷贝
1.4常用Rsync参数详解
-a, --archive
|
It is a quick way of saying you want recursion and want to preserve almost everything.
|
-r, --recursive
|
This tells rsync to copy directories recursively.
|
-t, --times
|
This tells rsync to transfer modification times along with the files and update them on the remote system
|
-u, --update
|
This forces rsync to skip any files for which the destination file already exists and has a date later than the source file
|
-z, --compress
|
With this option, rsync compresses any data from the files that it sends to the destination machine
|
-P
|
断点续传 详细显示传输过程(传输进度)
|
-c, --checksum
|
This forces the sender to checksum all files using a 128-bit MD4 checksum before transfer
|
-n, --dry-run
|
This tells rsync to not do any file transfers, instead it will just report the actions it would have taken.
|
--delete
|
This tells rsync to delete any files on the receiving side that aren''t on the sending side
|
--bwlimit=KBPS
|
This option allows you to specify a maximum transfer rate in kilobytes per second
|
--protocol
(隐藏参数)
|
选择传输时使用的TCP/IP协议字段号
|
-B
|
--block-size=SIZE checksum blocking size (default 700)
|
1.5服务器逻辑
两台服务器相邻,在同一个机房
1.6 rsync server模式配置
1、目标主机(DST)设置:
(1)添加rsyncd.conf配置文件
cat>/etc/rsyncd.conf<<EOF
uid=root
gid=root
secrets file = /etc/rsyncd.secrets
max connections=36000
use chroot=no
log file=/var/log/rsyncd.log
pid file=/var/run/rsyncd.pid
lock file=/var/run/rsyncd.lock
[rsyncDST]
path=/home/work/rsyncDST/share/1/0/
comment = rsync test
ignore errors = no
read only = no
hosts allow =10.0.101.241
hosts deny = *
EOF
|
|