測試centos5.2內建的rsync無法讀取.conf設定檔,後來放棄內建的rsync,在以下地址下載源碼編譯安裝
:http://mattmccutchen.net/rsync/packages.html ,目前最新版是3.04
解壓編譯
./configure --prefix=/usr/local/rsync
make
make install
建立一個rsyncd.conf設定檔
[root@localhost bin]# vi rsyncd.conf
nimal configuration file for rsync daemon
# See rsync(1) and rsyncd.conf(5) man pages for help
# This line is required by the /etc/init.d/rsyncd script
pid file = /var/run/rsyncd.pid
port = 873
address = 192.168.139.77
#uid = nobody
#gid = nobody
uid = root
gid = root
use chroot = no
read only = yes
#limit access to private LANs
hosts allow=192.168.139.66
hosts deny=*
max connections = 5
motd file = /etc/rsyncd/rsyncd.motd
#This will give you a separate log file
#log file = /var/log/rsync.log
#This will log every file transferred - up to 85,000+ per user, per sync
#transfer logging = yes
log format = %t %a %m %f %b
syslog facility = local3
timeout = 300
[usr]
path = /usr
list=no
ignore errors
comment = usr
auth users = root
secrets file = /etc/rsyncd/rsyncd.secrets #注意這個檔案只能設為600許可權
再像這樣啟動rsync
[root@localhost bin]# rsync --daemon --config=/usr/local/rsyncd/bin/rsyncd.conf
windows備份機上安裝cwRsync
:http://www.softpedia.com/progDownload/cwRsync-Download-45383.html
安裝好之後這樣串連到linux擷取檔案,如果沒有問題應該看到Password:字樣的提示,
D:\Program Files\cwRsync\bin>rsync -vzrtopg --progress --delete root@192.168.139.77::usr .\temp\
其中 temp 我是建在bin下,現在還不知道用什麼方法把備份目錄建到別的盤
參考:http://www.linuxsir.org/main/?q=node/256