rsync 通過密碼文件實現遠程同步


https://my.oschina.net/yyping/blog/91964

 

1、源文件服務器:192.168.10.203

2、備份服務器:192.168.10.88

配置備份服務器(192.168.10.88)

vim /etc/rsync.conf uid = www gid = www read only = no hosts allow = * [web] path = /var/www auth users = yyp secrets file = /etc/rsyncd.secrets
vim /etc/rsyncd.secrets yyp:123456 chmod 600 /etc/rsyncd.secrets
useradd yyp
echo "123456" | passwd yyp --stdin
mkdir /var/wwww
啟動服務
rsync --daemon --config=/etc/rsyc.conf

 配置源服務器

vim /etc/rsyncd.secrets 123456 chmod 600 /ec/rsyncd.secrets
mkdir /var/www
 同步文件
rsync -avz --password-file=/etc/rsyncd.secret /var/www yyp@192.168.10.88::web
錯誤匯總:
rsync: recv_generator: mkdir "test" (in dest) failed: Permission denied (13) *** Skipping everything below this failed directory *** 這個表明權限不正確解決辦法三個:(1)把備份服務器/etc/rsync.conf gid和uid 修改為root; (2)把備份目錄上的權限設置為777;(3)修改備份目錄擁有者和所屬組為/etc/rsync.conf配置文件中的gid和uid
rsync: read error: Connection reset by peer (104)rsync error: error in rsync protocol data stream (code 12) at io.c(614) [receiver=2.6.8] 通過日志/var/log/messages查看得到 rsync: unable to open configuration file "/etc/rsync.conf": No such file or directory (2) 做一個軟連接上去:ln -s /etc/rsyncd.conf /etc/rsync.con


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM