rsync 文件同步 服務器和客戶端配置

rsync 配置:

#解壓:
tar zxvf rsync-3.1.1.tar.gz
cd rsync-3.1.1
#編譯安裝
./configure --prefix=/usr/local/rsync
make
make install

#################服務端:

vi /etc/xinetd.d/rsync
         將其中改成:  disable = no

#隨系統啓動RSYNC
chkconfig rsync on

#配置/etc/rsyncd.conf(需要手動生成,不加註釋)

uid = root  
gid = root
use chroot = no
max connections = 4   
strict modes = no               
port = 873                      

pid file = /var/run/rsyncd.pid      
lock file = /var/run/rsync.lock     
log file = /var/log/rsyncd.log      

[test]
path = /data/test
hosts allow = 121.40.53.233
auth users = test
secrets file = /etc/rsync.pas

#  配置/etc/rsync.pas 用戶密碼
test:123qwe

#賦權限
chown root.root /etc/rsync.pas
chmod 600 /etc/rsync.pas

# 啓動
/usr/local/rsync/bin/rsync  --daemon

# 檢查rsync
netstat -a | grep rsync

################# 客戶端:

#  配置/etc/rsync.pas 用戶密碼
123qwe

#賦權限
chown root.root /etc/rsync.pas
chmod 600 /etc/rsync.pas

#同步文件
/usr/local/rsync/bin/rsync  -vzrtopg --progress --exclude=.svn --delete [email protected]::test /home/backup --password-file=/etc/rsync.pas


/usr/local/rsync/bin/rsync  -vzrtopg --progress --exclude=.svn --delete [email protected]::test /tmp/blockip --password-file=/etc/rsync.pas

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章