change UID+GID on target system?

Uwe Brauer oub at mat.ucm.es
Mon Jun 18 06:36:16 MDT 2012


Hello

I googled about my problem and found some hints but not a
complete solution.

Situation:
On laptop 1, I am user oub (uid=1000) and in the sudo list.
I connect an USB drive (jfs file system), its get automatically
mounted with the correct uid.
I copy files with rsync from laptop 1 to the USB.
( rsync -auvz --progress /home/oub/files /media/usb )

However:
On laptop 2, I am user oub (uid=1002) and in the sudo list.
Now when I connect the USB (jfs file system) its get automatically
mounted however as uid=1000 which is another user on Laptop2.
There is a patch for mount which allows to set the UID and
GID of the usb drive, but this patch is not standard.
https://lwn.net/Articles/497106/

So the only solution I see is to use chmod -R (and chgrp -R)
on the target system and then run rsync to copy from the USB
to Laptop2.

And later to the inverse operation.

Is there any possibility that rsync, running with sudo,
changes the files it copies to the UID +GIDof the target system?


Thanks and regards

Uwe Brauer 



More information about the rsync mailing list