本部落格所用的伺服器是阿里雲的CenteOS 6.3,而之前都是給公司的伺服器配置備份同步,今天給自己的伺服器配置備份以及備份。
第一步: 安裝Rsync服務
查看是否安裝Rsync服務
安裝Rsync服務
第二步: 配置Rsync.conf檔案
在/home/jhonse/etc/下建立rsync.conf
代碼如下
uid = root
gid = root
use chroot = no
max connections = 2
strict mades = yes
port = 873
pid file = /home/jhonse/var/run/rsyncd.pid
lock file = /home/jhonse/var/run/rsync.lock
log file = /home/jhonse/var/log/rsyncd.log
[jhonseCode]
path = /www
read only = false
transfer logging = yes
list = no
hosts allow = *
auth users = root
secrets file = /home/jhonse/etc/rsyncd.secrets
[jhonseDataBase]
path = /alidata/server/mysql/var
read only = false
transfer logging = yes
list = no
hosts allow = *
auth users = root
secrets file = /home/jhonse/etc/rsyncd.secrets
第三步: 建立rsyncd.secrets密碼檔案
格式: 使用者:密碼
並設定該檔案的許可權
chmod 600 /home/jhonse/etc/rsyncd.secrets
第四步: 啟動rsync服務端
rsync --daemon --config=/home/jhonse/etc/rsyncd.conf