rsync: chgrp failed: Operation not permitted (1)

来源:本站原创 IT小技巧 超过215 views围观 0条评论

用rsync 同步本地目录到远程服务器

rsync -ar  /data/service/  hadoop@192.168.10.156:/data/service/
rsync: chgrp "/data/service/." failed: Operation not permitted (1)
rsync: recv_generator: mkdir "/data/service/bin" failed: Permission denied (13)
*** Skipping any contents from this failed directory ***
rsync: recv_generator: mkdir "/data/service/etc" failed: Permission denied (13)
*** Skipping any contents from this failed directory ***
rsync: recv_generator: mkdir "/data/service/include" failed: Permission denied (13)
*** Skipping any contents from this failed directory ***
rsync: recv_generator: mkdir "/data/service/lib" failed: Permission denied (13)
*** Skipping any contents from this failed directory ***
rsync: recv_generator: mkdir "/data/service/libexec" failed: Permission denied (13)
*** Skipping any contents from this failed directory ***
rsync: recv_generator: mkdir "/data/service/sbin" failed: Permission denied (13)
*** Skipping any contents from this failed directory ***
rsync: recv_generator: mkdir "/data/service/share" failed: Permission denied (13)
*** Skipping any contents from this failed directory ***
rsync: mkstemp "/data/service/.LICENSE.txt.AUGp3J" failed: Permission denied (13)
rsync: mkstemp "/data/service/.NOTICE.txt.X5Qf9z" failed: Permission denied (13)
rsync: mkstemp "/data/service/.README.txt.ekL7eq" failed: Permission denied (13)

原因  hadoop用户没有目录的操作权,将目的目录修改为 hadoop所有者
hadoop@192.168.10.156:/data/service/

查看各台机器配置
java ~]# cat /etc/rsyncd.conf |grep -v ^#
uid = 1000
gid = 1000

查看目的目录的权限
service]# ll /data
total 0
drwxr-xr-x 2 root root 6 Jul 23 03:19 service

修改1
修改权限
data]# chown -R 1000:1000 /data/
data]# ll /data
total 0
drwxr-xr-x 2 hadoop hadoop 6 Jul 23 03:19 service

测试
java ~]# rsync -ar  /data/service/  hadoop@192.168.10.156:/data/service/

同步完成无报错

文章出自:CCIE那点事 http://www.jdccie.com/ 版权所有。本站文章除注明出处外,皆为作者原创文章,可自由引用,但请注明来源。 禁止全文转载。
本文链接:http://www.jdccie.com/?p=4181转载请注明转自CCIE那点事
如果喜欢:点此订阅本站
下篇文章: