The tar command should preserve symbolic links by default. I just tried a couple different attempts on my system using "tar cvjf tarball.tar.bz2 testdirectory/". I had links inside testdirectory that pointed to files within the directory and links that pointed outside the directory. All links were created--no dereferences.
Like I said, tar should preserve the symbolic links by default. So, you might want to check two things:
1. See if you have an alias for tar that includes the '-h' option automatically
2. Check your version of tar against any possible bug reports
For reference, my tar:
Code:
user@localhost$ tar --version
tar (GNU tar) 1.23
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by John Gilmore and Jay Fenlason.