help-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Help-tar] compress list of files, when root folder is a symlink


From: Luís Martins
Subject: [Help-tar] compress list of files, when root folder is a symlink
Date: Fri, 24 May 2019 16:24:41 +0100

Hi,

    I'm facing an issue with tar (1.29) where I want to compress a list of files inside a folder (passed to tar using a file), where the root folder in that list is a symlink. When I do this (example below), the output file is broken and I don't understand if this is a bug or a limitation of tar.
    Can someone help me make sense of this ?

PS: BTW, if I dereference all symlinks with -h it works, but it's not useful for my use case.

Example:
rm -rf /tmp/test
mkdir -p /tmp/test/uncompress-folder
mkdir -p /tmp/test
mkdir -p /tmp/test/subfolder
ln -s /tmp/test/subfolder /tmp/test/subfolder-symlink
touch /tmp/test/subfolder/dummyfile
ln -s /tmp/test/subfolder/dummyfile /tmp/test/subfolder/dummyfile-symlink
cd /tmp/test/
find ./subfolder-symlink/ > files.txt
tar -S -c -T files.txt -zf uncompress-folder/corrupted-tar.tar.gz
cd uncompress-folder
tar -tf corrupted-tar.tar.gz
tar -zxvf corrupted-tar.tar.gz

Best regards,
Luis

reply via email to

[Prev in Thread] Current Thread [Next in Thread]