Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to create a tarball, and there is one specific file that I need to preserve as a symlink in the tarball. However, there are a lot of other symlinks that I can't preserve as symlinks, because they point to files outside the scope of the tarball - if I don't use the "-h" option the tarball will be useless to anybody but me.

Is there a way I can override the "-h" option for a single file?

share|improve this question
up vote 1 down vote accepted

Try this

Untested!

  1. Create the tarball (excluding all symlinks)
  2. Use the --append flag to add the one symlink you
    want tar -h --append --file=mytarball.tar MySymlink

How to Add Files to Existing Archives

share|improve this answer
    
brilliant! thanks, I'll test this myself when I get a chance, and accept your answer. – Michael Sep 26 '12 at 18:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .