I'm running a rsync via apache to sync an assets directory
rsync -avz -e 'ssh -l rsync -i /home/rsync/.ssh/rsync -o StrictHostKeyChecking=no' /var/www/html/site/Uploads centos@$IP:/var/www/html/site/Uploads
This works correctly but the ownership changes from apache to centos as it's the user. I could setup the keys for the apache user however that user can't be logged in so that doesn't work.
How can I get rsync to either run as apache to preserve the ownership or run as the centos user and maintain the owner as apache (cron won't work for my case).