【Rsync專題】線上環境之rsync配置應用

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 .優化

相關文章
相關標籤/搜索