Problem
the tar(C) utility cannot back up a file with a pathname longer
than 100 characters. Attempting to create a tar archive with
input files having pathnames exceeding 100 characters results
in an error:tar: <long pathname> : pathname too long Solution
One possible workaround is to create symbolic links for a portion
of the pathname so that tar actually sees less than 100 total
characters in the full path. For example, to include this file
in the archive:/<30 char dir name>/<40 char dir name>/<40 char filename>
you can create a symbolic link in the root directory:
ln -s /<30 char dir name>/<40 char dir name> /short_nameThis effectively reduces the number of characters seen by tar in the first two pathname components from 72 to 11.
Thus, while in the root directory, you can create an archive of all files (including the 40-character long filename) in the 72-character long pathname by simply specifying the symlink instead:
tar cvLf archive short_nameNote the use of the "L" option to tar, which specifies to tar to actually follow the symlink to point to the actual files that are intended to be archived; by default, tar simply backs up the symlink without following it to the file actually pointed to. See the tar(C) man page for more details.
NOTE: This issue is not known to apply to other backup utilities, such
as cpio(C). Hence, another workaround is to use cpio or some
other utility to create the desired backup archives.