Operating System - HP-UX
1834814 Members
3100 Online
110070 Solutions
New Discussion

retain ownership with rcp or scp?

 
SOLVED
Go to solution
RobertCarback
Frequent Advisor

retain ownership with rcp or scp?

Is there a way to remote copy a file from one hp-ux server to another and retain ownership? I know that using the '-p' option retains permissions, but what about ownership? If not, any other way to copy across?
10 REPLIES 10
James R. Ferguson
Acclaimed Contributor

Re: retain ownership with rcp or scp?

Hi Robert:

You can use 'tar' or 'fbackup' to perform the copy.

Regards!

...JRF...
RobertCarback
Frequent Advisor

Re: retain ownership with rcp or scp?

are you saying I can use tar or fbackup across the lan from one server to another destination server?
James R. Ferguson
Acclaimed Contributor

Re: retain ownership with rcp or scp?

Hi Robert:

You can create a 'tar' archive (or for that matter specify a regular file as the output for 'fbackup'). Then copy (via your network) the archive to your target server and either un-tar it or 'frecover' it.

Regards!

...JRF...
Sundar_7
Honored Contributor

Re: retain ownership with rcp or scp?


# cd /local_dir
# tar -cvf - . | remsh remote_machine (cd /remote_dir;tar -xvf -)

Learn What to do ,How to do and more importantly When to do ?
Sundar_7
Honored Contributor

Re: retain ownership with rcp or scp?


# cd /local_dir
# tar -cvf - . | remsh remote_machine (cd /remote_dir && tar -xvf -)

Learn What to do ,How to do and more importantly When to do ?
RobertCarback
Frequent Advisor

Re: retain ownership with rcp or scp?

I'm confused on you rsyntax for tar. Tar doesn't like parentheses
RobertCarback
Frequent Advisor

Re: retain ownership with rcp or scp?

actually it doesn't look like the remsh is handling the '(' and ')' very well --

tar -xvf - . | remsh mxdddf01 ( cd /tmp/tartest ; tar -xvf - )


sh: Syntax error: `(' is not expected.
RobertCarback
Frequent Advisor

Re: retain ownership with rcp or scp?

JRF -- fyi -- I should have been more specific -- I have around 10 GB of data to transfer from one server to another. rcp does this in 40 minutes. I really don't have the disk available to fbackup or tar the 10 GB to disk. thanks
James R. Ferguson
Acclaimed Contributor
Solution

Re: retain ownership with rcp or scp?

Hi Robert:

> actually it doesn't look like the remsh is handling the '(' and ')' very well --

# tar -cvf - . | remsh mxdddf01 "( cd /tmp; tar -xvf - )"

Regards!

...JRF...
RobertCarback
Frequent Advisor

Re: retain ownership with rcp or scp?

That worked. Thanks!