如何告诉rsync不检查权限

我有两个目录,每个目录都有相同的 PHP应用程序.我想从一个源目录执行rsync -rvz到另一个目标,因此rsync将仅复制更改的文件.问题是源目录中的文件错误的755权限.目的地的权限很好.

如何告诉rsync忽略权限检查并仅按大小检查?
谢谢.

解决方法

只要您不提供-p标志,就不应该更改权限.如果你仍然没有获得你期望的权限,请确保关闭perms并使用–chmod = ugo = rwX

以供参考:
http://linux.die.net/man/1/rsync

-r,--recursive             recurse into directories
 -v,--verbose               increase verbosity
 -z,--compress              compress file data during the transfer
 -n,--dry-run               perform a trial run with no changes made

 -p,--perms                 preserve permissions
 -E,--executability         preserve executability
     --chmod=CHMOD           affect file and/or directory permissions

-p,–perms This option causes the receiving rsync to set the destination permissions to be the same as the source permissions. (See
also the –chmod option for a way to modify what rsync considers to be
the source permissions.)

该手册继续说:

In summary: to give destination files (both old and new) the source
permissions,use –perms. To give new files the destination-default
permissions (while leaving existing files unchanged),make sure that
the –perms option is off and use –chmod=ugo=rwX (which ensures that
all non-masked bits get enabled).

附注:如果可能的话,您的开发人员可能更有意义将其更改推回到仓库中,并让所有服务器使用代码仓库,而不是使用rsync将文件从一台服务器发送到另一台服务器.

相关文章

Linux中的ARP防火墙主要用于防御ARP欺骗攻击,其效果取决于多...
insmod和modprobe加-f参数导致Invalid module format错误 这...
将ArchLinux安装到U盘 几个月前入门Arch的时候上网搜了不少安...
1、安装Apache。 1)执行如下命令,安装Apache服务及其扩展包...
一、先说一下用ansible批量采集机器信息的实现办法: 1、先把...
安装配置 1. 安装vsftpd 检查是否安装了vsftpd # rpm -qa | ...