Web Hosting Talk







View Full Version : tar and symlinks


driverdave
10-19-2001, 07:59 PM
Does anyone know what options to specify when creating a symlink to have

ln -sn /home/somedirectory directory

tar -cvhf directory.tar directory

I want the tar file to remember that directory is a symlink, and not have it actually go into /home/somedirectory and tar all the files?

erik
10-21-2001, 06:45 PM
driverdave,

tar -cvhf directory.tar directory

Just drop the 'h'. The 'h' means don't dump symlinks; dump the
files they point to.

tar -cvf directory.tar directory will only tar the symlink and not the
directory that the symlink points to.

driverdave
10-21-2001, 10:41 PM
Thanks. It was just a force of habit to add that h.