change UID+GID on target system?

Uwe Brauer oub at
Wed Jun 20 04:56:42 MDT 2012

>> On Tue, 19 Jun 2012 13:50:00 +0000, "Voelker, Bernhard"
>> <bernhard.voelker at> wrote:

   >> Oh I see misunderstanding then. So what you propose is
   >> basically a chown of the directory in question?

   > no.

Why not? I am confused.

If I do, as user1 knowing passwd user2 
 rsync -auvz /home/oub/sourcedir user2 at localhost:/media/disk/targetdir

I have copied the content of sourcedir to target dir on USB,
and owner (UID+GID) is now user2

But if as user1 on Laptop1 I do

 rsync -auvz /home/oub/sourcedir /media/disk/targetdir

sudo chown -R  user2 /media/disk/targetdir
sudo chgrp -R  user2 /media/disk/targetdir

I obtain  the same result

Anyhow the problem is from Laptop2 to the USB, I would need
user2 passwd. I think it is best to have the same UID+GID on
both machines.
   > BTW: Why do you need it on the USB drive? I.e. why don't you
   > directly rsync from Laptop1 to Laptop2?

Because the connection is very unreliable, laptop 2 has a
dynamic IP, and I am paranoiac and don't want to have 

sshd: ALL

in hosts.allow on Laptop1


More information about the rsync mailing list