rsync部署指南


rsync是類unix系統(tǒng)下的數(shù)據(jù)鏡像備份工具——remote sync。一款快速增量備份工具 Remote Sync,遠(yuǎn)程同步 支持本地復(fù)制,或者與其他SSH、rsync主機(jī)同步。

安裝rsync

  • yum install rsync

配置:

rsync主要配置為3個(gè)文件
rsync.conf -- 主程序配置
rsyncd.motd -- 歡迎界面
rsyncd.secrets -- 賬戶密碼文件

rsync.conf

  • vim /etc/rsyncd.conf
  • 常規(guī)配置如下:
* pid file = /var/run/rsyncd.pid
* port = 873
* address = 127.0.0.1 **#填寫本地ip**
* uid = root
* gid = root
* use chroot = yes
* read only = yes  **#是否只讀**
* hosts allow= *
* max connections = 5
* motd file = /etc/rsyncd.motd
* log format = %t %a %m %f %b
* syslog facility = local3
* timeout = 300
  • 具體文件夾配置:
* [test] **#rsync目錄名**
* path = /data0/logs/test **#文件需要rsync的文件夾位置**
* list=yes
* ignore errors
* auth users = root
* secrets file = /etc/rsyncd/rsyncd.secrets **#密碼文件位置**
* comment = This directory use save XXX **#簡(jiǎn)介**
* exclude = a.log b.log  **#排除指定文件不顯示**

rsyncd.motd

  • vim /etc/rsyncd.motd
    隨意設(shè)計(jì),用于向client展示

rsyncd.secrets

  • mkdir /etc/rsyncd/
  • vim /etc/rsyncd/rsyncd.secrets
  • 輸入用戶名:密碼
    例如root:abcd123
  • chmod 700 /etc/rsyncd/rsyncd.secrets

啟動(dòng)

  • rsync --daemon
最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡(jiǎn)書(shū)系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

友情鏈接更多精彩內(nèi)容