My server at home uses rsync to backup files to my VPS, but I have an issue with setting the group property for uploaded files. Because the rsync uploads the data to a folder which can also be accessed from my FTP user I need them to have the ftpgroup group, otherwise I cannot download nor modify the files via FTP.
My rsync looks like this:
rsync -rtuvz --chmod=770 --owner --group --chown=user:ftpgroup /firstname.lastname@example.org/files/rsync_backup/ email@example.com:"/firstname.lastname@example.org/files/rsync_backup/"
The --chown flag with the rsync tool does not change anything, the files always have the group of the user that uploaded the files.
I've tried to set the group property via SSH but apparently only root users can use chown and chgrp, but I don't want to edit the sudoers file and give the user full access to chown, it's obviously a security hazard.
Is there a way to grant the user permissions to change group only for the files that he owns?