I'm transferring html pages to my web server with rsync with:
rsync -r -og --chown=transfer:www-data webpage/* transfer@myserver:/path/to/wwwfolder/
I use the transfer account (dedicated for data transfer and limited to rsync and scp by rssh); the transfer user is a member of the www-data group but its primary group is wizard; the www-data group is the primary group of the www-data user which is the user that runs the web server. The destination folder wwwfolder does not exists and is created by rsync.
With this setup I have two problems related to the destination folder wwwfolder:
the created folder is owned by transfer:wizard, thus the web server cannot read its content. How can I tell rsync that the owner should be transfer:www-data? This owner is correctly set for the folder content by means of the --chown flag but the flag seems to be ignored for the container folder
the created folder has drwxrw-rw- permissions, so even if I would be able to set the owner to transfer:www-data then it would still not be readable by the web server since the group does not have X permission. How can I specify the destination folder permissions to rsync?
Please note that I cannot simply login with ssh and use chown/chomd since the shell for the transfer user on the server only accepts rsync and scp commands for security reasons. The rsync version on both the server and the client is 3.1.2 protocol version 31.