rsync set group owner, group permission

Solution 1:

Right this minute, I'm looking for a way to do this in the rsync operation myself, as oppose to in a subsequent operation. I want some files not to be world readable and assign a group, thereby restricting access to the remote server processes within that group. But I haven't found one.

The only thing I can imagine is to:

  1. use --delay-updates to make putting the remote files in a more atomic, instantaneous operation assign
  2. g+rwx,o+rwx in the rsync --chmod option

and then run:

ssh remoteserver chgrp -R {groupname} /my/dest/folder/* && \
chmod -R o-rwx /my/dest/folder/*

Solution 2:

I think the -p flag is missing from your command ..

--chmod

This option tells rsync to apply one or more comma-separated "chmod" strings to the permission of the files in the transfer. The resulting value is treated as though it was the permissions that the sending side supplied for the file, which means that this option can seem to have no effect on existing files if --perms is not enabled.