
這個週末我升級了 Ubuntu 15.04。現在,rsync 不再發揮作用了:
當我嘗試運行這個時:
beheer@boson:~ $ rsync -Wvvqaz --log-file=rs.txt --delete-excluded --delete --no-g --password-file=/home/beheer/rsync.local.pwd --exclude=lost+found /home rsync://boson.local/boson-backup/boson/
我得到:
rsync: failed to connect to boson.local (10.0.1.220): Connection refused (111)
rsync error: error in socket IO (code 10) at clientserver.c(128) [sender=3.1.1]
日誌檔包含:
2015/05/25 19:00:54 [15163] opening tcp connection to boson.local port 873
2015/05/25 19:00:54 [15163] rsync: failed to connect to boson.local (10.0.1.220): Connection refused (111)
2015/05/25 19:00:54 [15163] rsync error: error in socket IO (code 10) at clientserver.c(128) [sender=3.1.1]
這是本地備份的嘗試。但是,嘗試從外部(Debian)伺服器執行類似的操作會傳回完全相同的錯誤。
$ systemctl |grep ufw
ufw.service loaded active exited Uncomplicated firewall
$ sudo ufw status
Status: inactive
$ sudo iptables -L
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
有什麼建議我還可以檢查什麼或可能出了什麼問題嗎?
編輯:按照下面的評論中的建議透過 ssh 使用 rsync 會產生相同的錯誤。
EDIT2:更新了防火牆 ( ufw
) 狀態並新增了iptables
狀態。
EDIT3:不應該有一個rsyncd
守護程式在運作嗎?
$ ps aux |grep rsync
beheer 8559 0.0 0.0 9492 2176 pts/0 S+ 10:23 0:00 grep --color=auto rsync
systemctl
也沒有顯示任何rsync
服務。谷歌上沒有提到這是必要的或如何創建它。
答案1
rsync.service 已安裝。你只需要非常努力地尋找。 ;-)
$ systemctl list-unit-files |grep rsync
rsync.service disabled
由於該服務預設已停用(...),您需要啟用它然後啟動它。
$ sudo systemctl enable rsync.service
Synchronizing state for rsync.service with sysvinit using update-rc.d...
Executing /usr/sbin/update-rc.d rsync defaults
Executing /usr/sbin/update-rc.d rsync enable
$ sudo systemctl start rsync.service
就這樣:
$ systemctl |grep rsync
rsync.service loaded active running fast remote file copy program daemon
這在重新啟動後仍然存在。這樣每次開機後就不需要手動啟動該服務了。