1. 程式人生 > >rsync資料同步時報錯:rsync: mkstemp 或rsync: delete,Permission denied

rsync資料同步時報錯:rsync: mkstemp 或rsync: delete,Permission denied

 場景:

用jekines自動構建java專案時,用到一個命令rsync -arqz --delete $WORKSPACE/target/yonghe-console/* [email protected]::yonghe-console --exclude-from="/mnt/exclude.list",同步資料時報錯,建立,刪除全部報錯:

rsync: mkstemp "" () failed: Permission denied,授權拒絕

eg:

2018/11/11 18:52:29 [19827] rsync: mkstemp "/WEB-INF/classes/com/baoding/app/.Initializer.class.LTZegt" (in yonghe-console) failed: Permission denied (13)
2018/11/11 18:52:29 [19827] rsync: mkstemp "/WEB-INF/classes/com/baoding/app/.JspContextPathView.class.Q0kBSC" (in yonghe-console) failed: Permission denied (13)
2018/11/11 18:52:29 [19827] rsync: mkstemp "/WEB-INF/classes/com/baoding/app/.MySessionContext.class.DgxYuM" (in yonghe-console) failed: Permission denied (13)
2018/11/11 18:52:29 [19827] rsync: mkstemp "/WEB-INF/classes/com/baoding/app/.MySessionListener.class.4gym7V" (in yonghe-console) failed: Permission denied (13)
2018/11/11 18:52:29 [19827] rsync: mkstemp "/WEB-INF/classes/com/baoding/app/.SecurityConfiguration.class.hn8KJ5" (in yonghe-console) failed: Permission denied (13)
2018/11/11 18:52:29 [19827] rsync: mkstemp "/WEB-INF/classes/com/baoding/app/.SystemProperty.class.k8Oamf" (in yonghe-console) failed: Permission denied (13)
2018/11/11 18:52:29 [19827] inflate returned -3 (21 bytes)
2018/11/11 18:52:29 [19827] rsync error: error in rsync protocol data stream (code 12) at token.c(548) [receiver=3.0.9]
2018/11/11 18:52:29 [19827] rsync: connection unexpectedly closed (181 bytes received so far) [generator]
2018/11/11 18:52:29 [19827] rsync error: error in rsync protocol data stream (code 12) at io.c(605) [generator=3.0.9]

 解決方案:

1、yonghe-console許可權不足:chown -R work.work yonghe-console執行後,重啟rsync服務

2、rsync配置檔案使用者資訊部分配置有錯:如uid=work寫成u=work.