當我使用rsync同步的時候,從我本地的機器到遠程服務器的機器上,同步出現錯誤,提示
rsync: failed to set times on “directory” Operation not permitted (1)
其中directory是遠程目標服務器上的一個目錄。
這個問題就是,因爲 /etc/rsync.conf 文件內,你指定的uid 、 gid 的問題, 這樣,你同步文件要寫的目錄 ,他的屬主和屬組 都要是/etc/rsync.conf 文件內指定的uid 、 gid ,
這樣就不會 rsync: failed to set times on 之類的錯誤了 !
(1)修改前,rsync 推送文件到目標服務器出錯 :
(2)去目標服務器查看 /etc/rsync.conf 文件,看uid和gid分別是什麼 :
(3)然後根據配置文件,把目標服務器的目標目錄,chown 目錄的屬主和屬組
以上設置後,就OK 了 ,同步正常 :
更多linux運維資料請關注:http://blog.linuxyan.com