Operating System - HP-UX
1821052 Members
2377 Online
109631 Solutions
New Discussion юеВ

Re: why does this cammand not work (part 2)

 
SOLVED
Go to solution
matthew mills
Frequent Advisor

why does this cammand not work (part 2)

thanks!
rcp -r -p ngbva:/oracle /

It works, I can copy a directory from one HPUX server to another. The problem now is that it keeps the permissions but changes the user:group on all files moved to root:sys. I have the same user name-userid and goup name-groupid on both systems. any ideas??

thanks in advance.
6 REPLIES 6
Robert-Jan Goossens
Honored Contributor

Re: why does this cammand not work (part 2)

Did you try the command I gave you ?

It keeps the all permissions.

0 points please
Peter Nikitka
Honored Contributor
Solution

Re: why does this cammand not work (part 2)

Hi,

I don't think this can be done with 'rcp'.
Use tar:
cd dest;
remsh nbgva 'cd /source;tar cf - .' | tar xf -

You can compress the stream, if networking is an issue:
remsh nbgva 'cd /source;tar cf - . | gzip' | gunzip | tar xf -

You may have to use the full path of gzip (or other compressing program).

mfG Peter
The Universe is a pretty big place, it's bigger than anything anyone has ever dreamed of before. So if it's just us, seems like an awful waste of space, right? Jodie Foster in "Contact"
RAC_1
Honored Contributor

Re: why does this cammand not work (part 2)

rcp -pr user1@source_host:/path user@destination_host:/path

Anil
There is no substitute to HARDWORK
matthew mills
Frequent Advisor

Re: why does this cammand not work (part 2)

robert,

the command: find /source | cpio -ov | remsh server " cd /copy ; cpio -idvum "

looks like it is pushing the files. do to the nature of the server I can not push files, only pull them. can this be modified to pull??
A. Clay Stephenson
Acclaimed Contributor

Re: why does this cammand not work (part 2)

You are reading something into the "-p" option that is not there. -p preserves the times fields and the permissions bits of the mode field. It says nothing about ownership:group; that is determined by the user doing the command. You need to use a scheme like cpio ... | remsh remotehost cpio ... to preserve all the attributes including setuid and setgid bits as well as ownership.

If it ain't broke, I can fix that.
Tom Smith_9
Frequent Advisor

Re: why does this cammand not work (part 2)

You could "su" to the oracle account and then issue the same "rcp" command. As long as the oracle "account" on the remote machine has a .rhosts entry this should work.