help-tar
[Top][All Lists]
Advanced

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

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


From: Reuti
Subject: Re: [Help-tar] compress list of files, when root folder is a symlink
Date: Fri, 24 May 2019 19:37:51 +0200

Hi,

Interesting that:

cd /tmp/test/uncompress-folder
tar tf corrupted-tar.tar.gz > included.txt

lists the expected three entries and fails do perform:

tar -T included.txt -xf corrupted-tar.tar.gz

while it only creates the symlink to the directory. But you can delete then the 
first line containing the symlink after this first run, and then the two files 
will be extracted in the second run.

-- Reuti


> Am 24.05.2019 um 17:24 schrieb Luís Martins <address@hidden>:
> 
> 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]