cp/scp

ne... guhvies at gmail.com
Thu Sep 6 10:54:28 UTC 2007


On 9/6/07, tony.chamberlain at lemko.com <tony.chamberlain at lemko.com> wrote:
>
> Hi
>
> Lets say I have two directories, /home/p1 and home/p2
>
> There is a file     /home/p1/file
> and then one     /home/p2/lnfile -> /home/p1/file
>
> (in other words   I did  ln -s /home/p1/file  /home/p2/lnfile)
>
> if I cd /home and do a
>
>    tar -zcvf tar.tz p1 p2
> or
>    scp -r p1 p2 10.0.0.20:
>
> then lnfile is no longer a symbolic link of file, but rather a duplicate.
> Is there anyway with tar and scp to preserver the link, symbolic or hard?
Not sure about tar but cpio should. Look at the -l --link option. This
is supposed to link files instead of copying them, when possible. I
have not tried it out. You will also have to look at all the options
tar uses to see if any would work. Maybe if you tar /home and exclude
all directories except p1 & p2, this might also work.

ne...
-- 
Registered Linux User # 125653 (http://counter.li.org)
Certified: 75% bastard, 42% of which is tard.
http://www.thespark.com/bastardtest
Now accepting personal mail for GMail invites.




More information about the users mailing list