LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   tar and symbolic links (https://www.linuxquestions.org/questions/linux-general-1/tar-and-symbolic-links-303157/)

cbriscoejr 03-18-2005 08:42 AM

tar and symbolic links
 
I have a symbolic link (/opt) that is linked to /usr/linkdir. I need to backup /opt and be able to restore /opt as a symbolic link to /usr/linkdir.

So far I have tried using the -h option

1)
tar cvhjf /opt opt.taj

from / directory -->tar xvhjf opt.taj
This creates /opt as a directory and it's subdirectory linkdir

2)
tar cvhjf /usr/linkdir opt.taj

from / directory -->tar xvhjf opt.taj
This writes to /usr/linkdir but does not create symbolic link /opt

Is there a way to tar /usr/linkdir and when you restore it it creatres the symbolic link /opt?


:Pengy:

APB_4 03-18-2005 05:45 PM

just tar opt then when you untar it "ln -s /opt /usr/linkdir"


All times are GMT -5. The time now is 09:33 PM.