Operating System - HP-UX
1834278 Members
2298 Online
110066 Solutions
New Discussion

Copy files with passing through the sym link

 
SOLVED
Go to solution
Jonathan Caplette_1
Super Advisor

Copy files with passing through the sym link

Hi,

I want to copy files from one server to another using rcp or any other commands... In the directories I try to copy I have sym link, and with the rcp command, the copy on the second box is receiving the data from the link... I don't want that! how can I do it?

Regards
Jonathan
8 REPLIES 8
James R. Ferguson
Acclaimed Contributor

Re: Copy files with passing through the sym link

Hi Jonathan:

Use 'fbackup' and 'frecover'. By default, 'fbackup' backs up a symbolc link, not the object to which it points.

See the manpages for each command for more information.

Regards!

...JRF...
Jonathan Caplette_1
Super Advisor

Re: Copy files with passing through the sym link

JFR, or anyone else...

How can I do it if I don't have access to a tape drive???

Jonathan
James R. Ferguson
Acclaimed Contributor

Re: Copy files with passing through the sym link

Hi (again) Jonathan:

OK, use 'tar' to collect all of your files into a tarball; copy ('ftp', 'rcp', etc) the tarball to your target server and un-tar it.

Regards!

...JRF...
Yang Qin_1
Honored Contributor

Re: Copy files with passing through the sym link

Hi, Jonathan, you can create a tar file on source server with those directories and then rcp the tar file to target server. You will have symbolic links in you tar file but you will not have the files they linked to.

Yang
Jonathan Caplette_1
Super Advisor

Re: Copy files with passing through the sym link

Can I do it on a single line of command?

JRF, sorry I mistyped your name previously!!
Yang Qin_1
Honored Contributor
Solution

Re: Copy files with passing through the sym link

Try this one:

tar cfv my.tar mydir | rcp my.tar user@server:my.tar

Yang
James R. Ferguson
Acclaimed Contributor

Re: Copy files with passing through the sym link

Hi (again) Jonathan:

OK; one-line:

# cd /source_path;tar -cf - .|remsh target_host "cd /destination_path && tar -xf -"

Regards!

...JRF...
Jonathan Caplette_1
Super Advisor

Re: Copy files with passing through the sym link

THanks guys,

The both way works fine, but I prefer the one shot as JRF proposed...

As always you guys are fast to answer!!

Regards
Jonathan