1833996 Members
2945 Online
110063 Solutions
New Discussion

Re: rcp question

 
SOLVED
Go to solution
Angela Swyers_1
Frequent Advisor

rcp question

I need to copy some directories from one server to another but when I do it, if there is a logical link it tries to copy the files from the link. I only want the link file not all files associated with it. Can I do that?
4 REPLIES 4
Todd McDaniel_1
Honored Contributor

Re: rcp question

Safest easiest way is to make a tarball...

Or you may be able to use a find command with -prune...in tics. With the rcp, although I have never tried that.

Unix, the other white meat.
TwoProc
Honored Contributor
Solution

Re: rcp question

tar handles links correctly - that is, after copying from one system to the other - they are still links.

cd /mysourcedir
tar cvf - . | remsh destmachine "cd /mydestdir; tar xvf - "

Simple as that.
We are the people our parents warned us about --Jimmy Buffett
Ross Minkov
Esteemed Contributor

Re: rcp question

Angela,

1. make a tarball
tar -cvf /tmp/test.tar /test
2. copy it over
use rcp or scp
3. untar it where you want it
tar -xvf test.tar

Regards,
Ross
Angela Swyers_1
Frequent Advisor

Re: rcp question

Thanks for your help. Using tar worked. Thanks.