I'd take a look at passing a tar through an ssh pipe.
something like the following:

tar czf - dir | ssh dest "tar xzfp --same-owner - -C destdir

David

On Tue, Nov 16, 2010 at 7:23 AM, James Carroll <jlcarr...@gmail.com> wrote:

> Newbie question again,
>
> So I am upgrading my server, and was trying to copy all the information in
> my home directories to the new machine while keeping the old machine up and
> running until the last minute. If the home drive had been local, I would
> have done cp -a oldhome newhome, but since I am doing this over the network,
> I wanted to do scp -a oldhome newhome, but scp doesn't have the -a option,
> so I manned scp, and it has a -p option, but that doesn't preserve
> user/group information, and the man page had no information that I could
> find about how to preserve user information while copying with scp.
>
> I did some work to get the user/group id's to be the same on both machines,
> now I just need to copy the files preserving this information.
>
> scp -p seemed to preserve privileges, but root ended up owning everything
> with everything in the group root. I could do the copy that way, and then
> change the user/group info recursively, but that will reek havoc with my
> shared git repos group settings which would be a pain to fix by hand. There
> HAS to be a better way.
>
> What is the right way to do this backup over ssh while preserving this
> user/group information? I figured that I could google it and find lots of
> ways of doing things (for example, I could mount nfs), but I was wondering
> what the RIGHT way to do this is, especially if I wanted to do it over ssh
> instead of nfs.
>
> Thanks a ton,
>
> James
>
> --
> Web: http://james.jlcarroll.net
>
> --------------------
> BYU Unix Users Group
> http://uug.byu.edu/
>
> The opinions expressed in this message are the responsibility of their
> author.  They are not endorsed by BYU, the BYU CS Department or BYU-UUG.
> ___________________________________________________________________
> List Info (unsubscribe here): http://uug.byu.edu/mailman/listinfo/uug-list
>
--------------------
BYU Unix Users Group 
http://uug.byu.edu/ 

The opinions expressed in this message are the responsibility of their
author.  They are not endorsed by BYU, the BYU CS Department or BYU-UUG. 
___________________________________________________________________
List Info (unsubscribe here): http://uug.byu.edu/mailman/listinfo/uug-list

Reply via email to