1

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?

1 Answer 1

1

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

1
  • brilliant! thanks, I'll test this myself when I get a chance, and accept your answer.
    – Michael
    Sep 26, 2012 at 18:59

You must log in to answer this question.

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