Operating System - HP-UX
1833767 Members
2275 Online
110063 Solutions
New Discussion

Re: remote copying (rcp) of symbolic links

 
SOLVED
Go to solution
Martin Simonis
Advisor

remote copying (rcp) of symbolic links

It appears that 'rcp -r' works differently from 'cp -r' in dealing with symbolic links. Is this a known feature ?

I have a directory A, containing a file B and a sub-directory C. Sub-directory C contains a symbolic link D back to file B.

If recursively copying (cp -r) A to a new location, then link E is correcly copied over within sub-directory D.

However, recursively remote copying 'rcp -r' does not create symbolic link E under directory D in the new location but an actual file of that name. So the amount of storage usage in the new location is much greater.

Is this really a feature of rcp, or am I doing something wrong, or is there a way around it ???
3 REPLIES 3
Robert-Jan Goossens_1
Honored Contributor
Solution

Re: remote copying (rcp) of symbolic links

I believe it is.

# cd /source_directory
# find . | cpio -ov | remsh hostname " cd /copy_directory ; cpio -idvum "

Regards,
Robert-Jan
Peter Godron
Honored Contributor

Re: remote copying (rcp) of symbolic links

Martin,
I would expect rcp to behave like this as the inital use of rcp was to copy between machines.
So just copying the link could result in a link to a file which had not been copied.
Example:
link on FileSystemA point to FileSystemB
Just copying the link (without the data) to another machine, without also copying FileSystemB would raise a fault when using the link.
Regards
Martin Simonis
Advisor

Re: remote copying (rcp) of symbolic links

Thanks for the answers !