LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-18-2005, 08:42 AM   #1
cbriscoejr
Member
 
Registered: Sep 2004
Location: Baltimore, Md
Distribution: Red Hat
Posts: 60

Rep: Reputation: 15
Question 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?


 
Old 03-18-2005, 05:45 PM   #2
APB_4
Member
 
Registered: Nov 2004
Distribution: KDE Neon User edition; Kubuntu; OpenSUSE Leap
Posts: 292

Rep: Reputation: 31
just tar opt then when you untar it "ln -s /opt /usr/linkdir"
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
cp and symbolic links? sausagejohnson Linux - General 3 07-19-2005 01:25 AM
tar overwriting symbolic links lapthorn Linux - General 1 03-18-2005 01:25 PM
tar wont work: Cannot exec: Too many levels of symbolic links abefroman Fedora - Installation 3 09-25-2004 02:54 PM
help with symbolic links sopiaz57 Linux - General 2 06-11-2004 06:17 PM
Symbolic links Valerie Linux - Newbie 12 03-31-2002 01:49 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:21 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration