听起来它工作正常.使用–owner和–group保留(未设置)所有者和组名称…这意味着您不希望它们在传输后更改.
如果不使用这些选项,则用户和组将更改为接收端的调用用户.如果要指定其他用户,则需要在脚本中添加chown命令.
-o, --owner
This option causes rsync to set the owner of the destination file to be
the same as the source file, but only if the receiving rsync is being run
as the super-user (see also the --super and --fake-super options). Without
this option, the owner of new and/or transferred files are set to the invoking
user on the receiving side...
-g, --group
This option causes rsync to set the group of the destination file to be the same as
the source file. If the receiving program is not running as the super-user (or if
--no-super was specified), only groups that the invoking user on the receiving side
is a member of will be preserved. Without this option, the group is set to the default
group of the invoking user on the receiving side...