Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

1 Answer 1

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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.