rsync but keep destination ownership without setting to source ownership
I've got some files which I would like to sync to a linux server. Only problem is it resets the ownership and group to the current user and group.
Unfortunately the options --owner, --group, and --archive are somewhat unworkable because the source is a windows machine. (it's ownership doesn't make sense on the server)
Any way to keep destination ownership unchanged?
Command i'm using (minimal example):
rsync SRC $remote:DEST
Try rsync -azvr something somwhere:/location/
.
Identify the user and group on the remote end. Example user "user1" and group "user1".
-
add "--chown user1:user1" to your rsync command
-
Alternatively if your version of rsync does not support that, on the remote, run "chown -R user1:user1 *" inside the highest folder of your destination file tree and this will recursively reown everything to user1. (WARNING: this syntax also changes everything in the current folder)