[ILUG] tar question

Niall O Broin niall at linux.ie
Thu Sep 15 12:48:03 IST 2005


On Friday 02 September 2005 16:15, Damien Gill wrote:

> Quick question hopefully someone knows the answer as my knowledge of
> tar-ing is pretty useless :-)
>
> A guy I know has been using tar to dump a directory out to tape using
> the command
>
>
>
> Tar -cvf /dev/st1 ../internal.data
>
>
>
> Now he needs to take the info back off the tape to a different directory
> when he runs the command
>
>
>
> Tar -xvf /dev/st1

> He gets an error (not sure if this is exact)
> tar:../internal.data member name contains ,..,  

This is curious. What platform is he using? The reason I say that it's curious 
is that gnu tar on Linux will strip such pathnames when the tar file is 
created and will give a warning (not error) message:

tar: Removing leading `../' from member names

You can force tar to include these path elements by using the -P option, and 
then when you extract the tar file, you will again get the warning

tar: Removing leading `../' from member names

which again you can override with the -P option. But in any event, this is 
only a warning so if his current directory is say /tmp/restore when he tries 
to extract the data from the tar file, it will appear 
in /tmp/restore/internal.data, and not /tmp/internal.data which he may have 
expected (unless he uses -P when creating AND extracting).


Niall

-- 
Niall



More information about the ILUG mailing list