rsync是类unix系统下的数据镜像备份工具,从软件的命名上就能够看出来了——remote sync。它的特性以下:web
一、能够镜像保存整个目录树和文件系统。
二、能够很容易作到保持原来文件的权限、时间、软硬连接等等。
三、无须特殊权限便可安装。
四、优化的流程,文件传输效率高。
五、能够使用rcp、ssh等方式来传输文件,固然也能够经过直接的socket链接。
六、支持匿名传输。ssh
安装rsync
#tar zxvf rsync-3.0.8.tar.gz
#cd rsync-3.0.8
#./configure && make && make installsocket
cat /etc/rsync.conf
uid = root
gid = root
use chroot = no
max connections = 20
strict modes = yes
log file = /var/log/rsyncd.log
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsync.lock
log format = %t %a %m %f %b
[web]
path = /data/server/test #备份目录
use chroot = yes
read only = noide
备份机上运行
[root@lx_web_s1 ~]#cd test
[root@lx_web_s1 test]# rsync -aP 192.168.52.175::web .
receiving file list ...
2 files to consider
./
121/
成功工具
若是要想与源目录数据保存一致:rsync -aP --delete 192.168.52.175::web .优化