I'm setting up
rsync to transfer files from ServerA to ServerB, and need to preserve timestamps and permissions. They key here is the files are owned by a different account than the one performing the file transfer.
rsync transfers files using the example below:
rsync -a /colorschemes/ email@example.com:/colorschemes/ --delete
-a flag yields the following types of errors:
rsync: failed to set times on "/colorschemes/946/ex": Operation not permitted (1) rsync: failed to set permissions on "/colorschemes/946/ex/blue.pdf": Operation not permitted (1)
On the remote system, the acoder account has a similar error when attempting to manually set permissions on a file:
[acoder@bu ~]$ chown apache:codingteam /colorschemes/946 chown: changing ownership of ‘/colorschemes/946’: Operation not permitted
This works OK, though:
[acoder@bu ~]$ sudo chown apache:codingteam /colorschemes/946
Is there a way to make the remote rsync use sudo?