Files Loosing Ownership after rsync

jw schultz jw at
Wed Aug 21 00:32:01 EST 2002

On Wed, Aug 21, 2002 at 08:57:11AM -0000, Mahesh Chandra Patil wrote:
> Hello,
> Greetings to all.
>  I am a newbie to rsync.  I have a problem,for which I could not 
> find the solution in Rsync Faq o Matiq. Even google couldnt give 
> any solution. So finally I am here..
> Currently I am using Rsync to backup data from two different 
> servers. server (a) and sserver (b).  The data from servers a & b 
> is rsynce'd to my third machine (c).  I have implemented ssh.  The 
> process is going fine. The data is being sysnced regularly.
> the syntax i am using is "/usr/bin/rsync --stats --partial 
> --progress --config=/etc/rsyncd.conf -essh -avzp 
> 123.456.11.22:/home/source /backup/dest"

--config only applies when starting a daemon which you aren't.
-p is included in -a.

> ONly hitch is when ever the data is reaching server (c).. all the 
> files are losing their ownership.  The file permissions (rwx) is 
> ok.  But only the ownership is failing.
> ON servers  (a) and (b)  there are various users and they are 
> different on a and b  ie.. for example  the uid 501, is having 
> different name on server (a) and different name on server (b).  I 
> cant create same users on my server (c).

If i understand you correctly you are saying that the
relevant user and group names exist on all three systems
but have differing IDs.  That being the case don't use the
--numeric-ids option but make sure that all relevant names
exist in passwd and group.

> I think this will be a great problem when I try to restore the 
> data back to the server, as all the ownership of the files will 
> fail.
> So kindly  guide me if there is any option that I am missing.
> If this subject is already discussed kindly  direct me to the 
> source.

It is discussed under -o --owner and -g --group but some
find it subtle.  The rsync process on the destination host
must be running as root.  This means that your example of 

	rsync --partial -e ssh -avz 123.456.11.22:/home/source /backup/dest

must be run as root.  And if you push the files

	rsync -e ssh -avz /backup/dest 123.456.11.22:/home/source

the remote login on the other end must be root as well, the
equivalent of

	rsync -e ssh -avz /backup/dest root at 123.456.11.22:/home/source

If the destination rsync process is running as a normal user
then all files will be created as that user per POSIX and
SUSv3 standards that disallow giving files away, see chown(2).

Perhaps this should be in a FAQ, it doesn't seem to be.

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

		Remember Cernan and Schmitt

More information about the rsync mailing list