一、总结
一、本地拷贝数据
命令 选项 源文件 目标
rsync [OPTION...] SRC... [DEST]
二、远程同步数据
1) pull拉取数据:
命令 选项 用户@主机地址:源文件 目标地址
rsync [OPTION...] [USER@]HOST:SRC... [DEST]
2) push推送数据:
命令 选项 源文件 用户@主机地址:目标地址
rsync [OPTION...] SRC... [USER@]HOST:DEST
三、守护进程模式
1) pull拉取数据命令
命令 选项 虚拟用户@主机地址 ::模块 目标
rsync [OPTION...] [USER@]HOST ::SRC... [DEST]
2) push推送数据命令
命令 选项 源文件 虚拟用户@主机地址 ::模块
rsync [OPTION...] SRC... [USER@]HOST ::DEST
选项:
-a
-v
-z
-r
-t
-o
-p
-g
-l
-P
-D
-L
-e
--delete
--exclude=PATTERN
--exclude-from=file
--partial
--password-file=xxx
1.限速传输
--bwlimit=100
[root@web01 /tmp]
sending incremental file list
./
data.txt
5,537,792 1% 100.04kB/s
2.数据一致
--delete
[root@web01 /tmp]
sending incremental file list
deleting file2
deleting file1
sent 223 bytes received 43 bytes 532.00 bytes/sec
total size is 0 speedup is 0.00
[root@web01 /tmp]
receiving incremental