title: How to change the owner for a rsync
body: <p>I understand preserving the permissions for rsync.
  However in my case my local computer does not have the user the files need to under for the webserver. So when I rsync I need the owner and group to be apache on the webserver, but be my username on my local computer. Any suggestions?</p>
  <p>I wanted to clarify to explain exactly what I need done.</p>
  <p>My personal computer: named 'home' with the user account 'michael'
  My web server: named 'server' with the user account 'remote' and user account 'apache'</p>
  <p>Current situation: My website is on 'home' with the owner 'michael' and on 'server' with the owner 'apache'. 'home' needs to be using the user 'michael' and 'server' needs to be using the user 'apache'</p>
  <p>Task: rsync my website on 'home' to 'server' but have all the files owner by 'apache' and the group 'apache'</p>
  <p>Problem: rsync will preseve the permissions, owner, and group; however, I need all the files to be owner by apache. I know the not preserving the owner will put the owner of the user on 'server' but since that user is 'remote' then it uses that instead of 'apache'. I can not rsync with the user 'apache' (which would be nice), but a security risk I'm not willing to open up.</p>
  <p>My only idea on how to solve: after each <code>rsync</code> manually <code>chown -R</code> and <code>chgrp -R</code>, but it's a huge system and this takes a long time, especially since this is going to production.</p>
  <p>Does anyone know how to do this?</p>
  <p>Current command I use to <code>rsync</code>:</p>
  <pre><code>rsync --progress -rltpDzC --force --delete -e &quot;ssh -p22&quot; ./ remote@server.com:/website
  </code></pre>