RSync服務(wù)器配置
服務(wù)器端:
確保安裝了rsync
配置/etc/rsyncd.conf,一般情況下安裝了rsync不會(huì)自動(dòng)創(chuàng)建rsyncd.conf,配置如下
# Rsync configuration file
secrets file = /etc/rsyncd.secrets #認(rèn)證用戶名和密碼文件的名稱和位置
motd file = /etc/rsyncd.motd #歡迎文件,可自己編輯
read>list = yes
uid = root
gid = root
use chroot = no
max connections = 5
log file = /var/log/rsyncd.log
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsync.lock
# Remote sync configuration module
[testsync]
comment = testsync directory
path = /home/chijianqiang
auth users = rsync
生成密碼文件
echo "rsync:password" >> /etc/rsyncd.secrets
chmod 600 /etc/rsyncd.secrets
啟動(dòng)rsync
rsync --daemon
從客戶端同步文件
rsync -vzrtopg --progress rsync@10.11.3.3::testsync /home/chjq
rsync -vzrtopg --delete --progress rsync@10.11.3.3::testsync /home/chjq
增加--delete參數(shù)會(huì)把原有chjq目錄下的文件刪除以保持客戶端和服務(wù)器端文件系統(tǒng)完全一致,慎用
確保安裝了rsync
配置/etc/rsyncd.conf,一般情況下安裝了rsync不會(huì)自動(dòng)創(chuàng)建rsyncd.conf,配置如下
# Rsync configuration file
secrets file = /etc/rsyncd.secrets #認(rèn)證用戶名和密碼文件的名稱和位置
motd file = /etc/rsyncd.motd #歡迎文件,可自己編輯
read>list = yes
uid = root
gid = root
use chroot = no
max connections = 5
log file = /var/log/rsyncd.log
pid file = /var/run/rsyncd.pid
lock file = /var/run/rsync.lock
# Remote sync configuration module
[testsync]
comment = testsync directory
path = /home/chijianqiang
auth users = rsync
生成密碼文件
echo "rsync:password" >> /etc/rsyncd.secrets
chmod 600 /etc/rsyncd.secrets
啟動(dòng)rsync
rsync --daemon
從客戶端同步文件
rsync -vzrtopg --progress rsync@10.11.3.3::testsync /home/chjq
rsync -vzrtopg --delete --progress rsync@10.11.3.3::testsync /home/chjq
增加--delete參數(shù)會(huì)把原有chjq目錄下的文件刪除以保持客戶端和服務(wù)器端文件系統(tǒng)完全一致,慎用
身邊越來越多的人開始使用Mac,經(jīng)常被問道Mac的使用問題和技術(shù)問題。遂決定,每天發(fā)布一則#Mac技巧#。同時(shí)發(fā)布于微博和微信公眾賬號(hào)“Mac技巧”,微信號(hào)sagacity-mac,有微信賬號(hào)的童鞋掃描下圖片或搜索微信號(hào)即可

浙公網(wǎng)安備 33010602011771號(hào)