Preserve owner/group on TARGET

jw schultz jw at
Wed Sep 10 10:18:15 EST 2003

On Tue, Sep 09, 2003 at 01:48:41PM -0400, Dan Robichaud wrote:
> Hello,
> I've been using rsync for some time as a data migration tool, but this time
> I'm trying to do something a little different, and I can't seem to make
> things work the way I want.  Essentially, I want to rsync data from a
> source, but I want the owner/group/perms on the TARGET to not change (i.e.
> not get updated with the owner/group/perms from the source).  In testing I
> discovered that using the -a or -ogp options WILL transfer over the
> owner/group/perms, but when I leave out these options, the target file
> becomes owned by root (the user running the rsync).  Am I missing something
> really obvious, or is there no way to have the TARGET owner/group/perms
> remain as-is?

You have to make a distinction between new files and
existing files being updated.  Existing files should retain
their ownership and perms.  New files should be owned by
the creator.  Group ownership should depend on the file
creation semantics of the parent directory.

> To keep things simple, I have NFS mounted the source and target filesystems
> and am rsyncing them as if they were local using the following command:

Adding NFS to the mix actually complicates things.

> rsync -xvr --stats $SOURCEmnt/ $TARGETmnt

	J.W. Schultz            Pegasystems Technologies
	email address:		jw at

		Remember Cernan and Schmitt

More information about the rsync mailing list