Maintaining ownership of files

Mike Noble mgnoble at gmail.com
Sat Jul 23 06:22:55 UTC 2005


Todd Cary wrote:
> When I do
> 
>  scp -rp * 192.168.0.12://mydir
> 
> as root, all of the files and sub-files are owned by root.  I would like
> to have them keep their original owners (and groups).
> 
> Can this be done?
> 
> Todd
> 

I always use rsync for purposes like this, using rsync for the above
command would be:

rsync -a -e ssh * 192.168.0.12:/mydir

Actually not sure about the "*", I always use the path to the directory
to copy and if I want the contents of the directory then end the path
with a "/".  See man page for rsync for all the options to rsync.

Mike

-- 
Mike Noble
mgnoble at gmail.com
Key ID: 0xFFDFC13B
Keyserver: http://pgpkeys.mit.edu




More information about the fedora-list mailing list