2010年5月19日 星期三

linux rsync備份至不同機器

target(被丟的)
# vi /etc/rsyncd.conf
    [mch1]
path = /backup
auth users = tatsumilk
uid = root
gid = root
secrets file = /etc/rsyncd.secrets
read only = no
# vi /etc/rsyncd.secrets
tatsumilk:1234567

# chmod 600 /etc/rsyncd.secrets
重要!不然會auth failed

# rsync --daemon

initiator(丟人的)
# vi /home/.../rsyncd.secrets
1234567

# rsync -av --password-file=/home/.../rsyncd.secrets /send tatsumilk@targetIP::mch1

如果上面沒有改權限則會出現下面訊息
@ERROR: auth failed on module mch1
rsync error: error starting client-server protocol (code 5) at main.c(1383) [sender=2.6.9]

參考網頁
http://www.csie.nctu.edu.tw/~tsaiwn/course/introcs/history/linux/linux.tnc.edu.tw/techdoc/rsync.htm

沒有留言:

張貼留言