標籤:os ar 檔案 art div sp on c ad
Rsync服務端部署流程
Rsync服務端部署流程:
一、rsync服務端配置流程
- 配置rsync設定檔/etc/rsyncd.conf
- 建立同步的本地目錄/dingjian 並根據需要授權
目錄和/etc/rsync.password為設定檔中path = /dingjian/參數的配置
- 帳號密碼檔案配置:
echo "rsync_backup:dingjian">/etc/rsync.password
chmod 600 /etc/rsync.password
提示:
1)/etc/rsync.password為設定檔中secrets file = /etc/rsync.password參數的配置
2)帳號rsync_backup為/etc/rsync.password為設定檔中auth users = rsync_backup參數的配置
4. 啟動rsync服務
[[email protected] dingjian]# rsync --daemon
[[email protected] dingjian]# echo "/usr/bin/rsync --daemon">>/etc/rc.local
[[email protected] dingjian]# cat /etc/rc.local |grep daemon
[[email protected] dingjian]# ps -ef |grep rsync
重起
[[email protected] dingjian]# pkill rsync
[[email protected] dingjian]# rsync --daemon
[[email protected] dingjian]# ps -ef |grep rsync
二、rsync用戶端配置流程:
[[email protected] etc]# echo "dingjian">/etc/rsync.password
chmod 600 /etc/rsync.password
提示:
用戶端的/etc/rsync.password和服務端的/etc/rsync.password沒有任務關係,只要和用戶端rsync命令接的參數—password-file=/etc/rsync.password中的路徑對應即可
三、rsync用戶端命令操作細節
推送整個目錄
rsync -avz /tmp [email protected]::dingjian --password-file=/etc/rsync.password
只推送目錄中的檔案
rsync -avz /tmp/ [email protected]::dingjian --password-file=/etc/rsync.password
抓取rsync模組對應目錄裡的檔案
rsync -avz [email protected]::dingjian --password-file=/etc/rsync.password /tmp
Rsync服務端部署流程