The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
need some info about symbolic link and hard link detective linux UNIX for Dummies Questions & Answers 2 01-08-2008 03:36 AM
Symbolic Link Confusion Sepia UNIX for Dummies Questions & Answers 5 05-07-2007 02:40 PM
Creating symbolic link charbel Shell Programming and Scripting 9 10-01-2006 08:46 AM
symbolic Link bhargav UNIX for Dummies Questions & Answers 1 10-15-2004 06:41 AM
1 symbolic link to 2 different places? Bashar UNIX for Advanced & Expert Users 2 08-27-2003 04:40 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 05-23-2008
Registered User
 

Join Date: Jan 2008
Posts: 25
tar the symbolic link

Hi Experts!!

Can anyone help me out to know how can we tar the symbolic links. I would need to find the symbolic links present in the directory and then tar them out. I can find the links by find . -type l, but i need to know how to tar the symboilc link. Any help would be much appreciated..

Many thanks !!
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 05-23-2008
Registered User
 

Join Date: Mar 2008
Location: /bin/sh
Posts: 343
Normally, when tar archives a symbolic link, it writes a record to the archive naming the target of the link. In that way, the tar archive is a faithful record of the filesystem contents. `--dereference' (`-h') is used with `--create' (`-c'), and causes tar to archive the files symbolic links point to, instead of the links themselves. When this option is used, when tar encounters a symbolic link, it will archive the linked-to file, instead of simply recording the presence of a symbolic link.

The name under which the file is stored in the file system is not recorded in the archive. To record both the symbolic link name and the file name in the system, archive the file under both names. If all links were recorded automatically by tar, an extracted file might be linked to a file name that no longer exists in the file system.

If a linked-to file is encountered again by tar while creating the same archive, an entire second copy of it will be stored. (This might be considered a bug.)

So, for portable archives, do not archive symbolic links as such, and use `--dereference' (`-h'): many systems do not support symbolic links, and moreover, your distribution might be unusable if it contains unresolved symbolic links.
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 06:20 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0