Review your favorite Linux distribution.
Go Back > Forums > Linux Forums > Linux - General
User Name
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.


  Search this Thread
Old 03-18-2005, 08:42 AM   #1
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

tar cvhjf /opt opt.taj

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

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
Registered: Nov 2004
Distribution: KDE Neon User edition; Manjaro; OpenSUSE Leap
Posts: 294

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


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 > Forums > Linux Forums > Linux - General

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

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