来自以下的联机帮助页rsync
:
rsync 的一些附加功能包括:
- 不需要超级用户权限
rsync
流程需要的是正确的吗
- 每个源文件的读取权限,
- 以及对每个目标文件的写权限?
有什么不正确或遗漏的地方吗?
为什么联机帮助页说rsync
“不需要超级用户权限”?
谢谢。
答案1
因为它不是守护进程,只要您有权限读取(源)和写入(目标),就像您所说的那样,它就可以工作,并且它(在某种程度上)允许您保留副本中的所有权/属性,即使您不是 root 或目标计算机上的用户(请阅读 --super 和 --fake-super,为此目标计算机必须与 ACL 兼容)。
来自 rsync 的同一手册页:
--fake-super
When this option is enabled, rsync simulates super-user activi‐
ties by saving/restoring the privileged attributes via special
extended attributes that are attached to each file (as needed).
This includes the file’s owner and group (if it is not the
default), the file’s device info (device & special files are
created as empty text files), and any permission bits that we
won’t allow to be set on the real file (e.g. the real file gets
u-s,g-s,o-t for safety) or that would limit the owner’s access
(since the real super-user can always access/change a file, the
files we create can always be accessed/changed by the creating
user). This option also handles ACLs (if --acls was specified)
and non-user extended attributes (if --xattrs was specified).
This is a good way to backup data without using a super-user,
and to store ACLs from incompatible systems.
编辑并澄清:“不需要超级用户权限”并不意味着成为超级用户没有用。这只是意味着无论如何它(大部分)都会起作用。