Tar help

Tar help

Post by Dipesh J. Hinduj » Wed, 08 Aug 2001 06:38:52



Ok, so now I know the mantra of don't use absolute pathes in Tar
files.  But I have one that I did that is and really need to restore it
to another directory.  Any ideas how I can do this?

Thanks.

--
Dipesh J. Hinduja
Georgia Institute of Technology, Atlanta Georgia, 30332

 
 
 

Tar help

Post by Logan Sh » Wed, 08 Aug 2001 06:48:01




Quote:>Ok, so now I know the mantra of don't use absolute pathes in Tar
>files.  But I have one that I did that is and really need to restore it
>to another directory.  Any ideas how I can do this?

I believe GNU tar can help you.  See http://www.veryComputer.com/

 - Logan
--
"Our grandkids love that we get Roadrunner and digital cable."
(Adverti*t for Time Warner cable TV and internet access, July 2001)

 
 
 

Tar help

Post by Joerg Schilli » Wed, 08 Aug 2001 20:59:26




Quote:>Ok, so now I know the mantra of don't use absolute pathes in Tar
>files.  But I have one that I did that is and really need to restore it
>to another directory.  Any ideas how I can do this?

If it's in standard tar format use "star".

        ftp://ftp.fokus.gmd.de/pub/unix/star/

if it's in GNUtar format you may also use GNUtar.

--



URL:  http://www.fokus.gmd.de/usr/schilling    ftp://ftp.fokus.gmd.de/pub/unix

 
 
 

Tar help

Post by Joerg Schilli » Wed, 08 Aug 2001 20:59:55






>>Ok, so now I know the mantra of don't use absolute pathes in Tar
>>files.  But I have one that I did that is and really need to restore it
>>to another directory.  Any ideas how I can do this?

>I believe GNU tar can help you.  See http://www.gnu.org/software/tar/ .

But it cannot read standard tar archives :-(

--



URL:  http://www.fokus.gmd.de/usr/schilling    ftp://ftp.fokus.gmd.de/pub/unix

 
 
 

Tar help

Post by Andy Lennar » Wed, 08 Aug 2001 21:27:23








>>>Ok, so now I know the mantra of don't use absolute pathes in Tar
>>>files.  But I have one that I did that is and really need to restore it
>>>to another directory.  Any ideas how I can do this?

>>I believe GNU tar can help you.  See http://www.gnu.org/software/tar/ .

>But it cannot read standard tar archives :-(

the version I have, 1.12, says it
 "cannot read nor produce '--posix' archives"

but it seems able to read archives created by /bin/tar. Perhaps I'm
missing something?


 
 
 

Tar help

Post by Joe Durusa » Thu, 09 Aug 2001 03:24:37


        The simple way out of a problem like this is to
create whatever dir you need (temporarily), restore the file, move
it to it's final destination, and remember to use relative pathnames
next time.  Much faster than finding special progs, etc.

Speaking only for myself,

Joe Durusau




> >Ok, so now I know the mantra of don't use absolute pathes in Tar
> >files.  But I have one that I did that is and really need to restore it
> >to another directory.  Any ideas how I can do this?

> If it's in standard tar format use "star".

>         ftp://ftp.fokus.gmd.de/pub/unix/star/

> if it's in GNUtar format you may also use GNUtar.

> --



> URL:  http://www.fokus.gmd.de/usr/schilling    ftp://ftp.fokus.gmd.de/pub/unix

 
 
 

Tar help

Post by Joerg Schilli » Thu, 09 Aug 2001 03:36:51




Quote:>>>>Ok, so now I know the mantra of don't use absolute pathes in Tar
>>>>files.  But I have one that I did that is and really need to restore it
>>>>to another directory.  Any ideas how I can do this?

>>>I believe GNU tar can help you.  See http://www.gnu.org/software/tar/ .

>>But it cannot read standard tar archives :-(

>the version I have, 1.12, says it
> "cannot read nor produce '--posix' archives"

>but it seems able to read archives created by /bin/tar. Perhaps I'm
>missing something?

The point is that many tar files that are POSIX may be extracted by
GNU tar but not all of them. If you like a 90% solution, stay with
GNU tar otherwise you should use a program that is closer to the standard.

--



URL:  http://www.fokus.gmd.de/usr/schilling    ftp://ftp.fokus.gmd.de/pub/unix

 
 
 

Tar help

Post by Joerg Schilli » Thu, 09 Aug 2001 03:46:33




Quote:>    The simple way out of a problem like this is to
>create whatever dir you need (temporarily), restore the file, move
>it to it's final destination, and remember to use relative pathnames
>next time.  Much faster than finding special progs, etc.

But if somebody likes to extract someting like /etc from another
machine you your method does not work.

I never use anything besides "star" if I have the choice. This is
anytime when I am not forced to do a "quick hack" (< 5 Minutes)
on a machine and then leave.



>> >Ok, so now I know the mantra of don't use absolute pathes in Tar
>> >files.  But I have one that I did that is and really need to restore it
>> >to another directory.  Any ideas how I can do this?

--



URL:  http://www.fokus.gmd.de/usr/schilling    ftp://ftp.fokus.gmd.de/pub/unix
 
 
 

Tar help

Post by Joe Durusa » Thu, 09 Aug 2001 22:30:36


I agree that there is no good substitute for doing it right in the
first place.  However, it appears that chroot might be able to solve the
problem in the case in point, although it seems a lot of trouble.
(Admittedly chroot and gen-ing up temp directories, etc, etc)

Speaking only for myself,

Joe Durusau




> >       The simple way out of a problem like this is to
> >create whatever dir you need (temporarily), restore the file, move
> >it to it's final destination, and remember to use relative pathnames
> >next time.  Much faster than finding special progs, etc.

> But if somebody likes to extract someting like /etc from another
> machine you your method does not work.

> I never use anything besides "star" if I have the choice. This is
> anytime when I am not forced to do a "quick hack" (< 5 Minutes)
> on a machine and then leave.



> >> >Ok, so now I know the mantra of don't use absolute pathes in Tar
> >> >files.  But I have one that I did that is and really need to restore it
> >> >to another directory.  Any ideas how I can do this?

> --



> URL:  http://www.fokus.gmd.de/usr/schilling    ftp://ftp.fokus.gmd.de/pub/unix

 
 
 

Tar help

Post by Stefan Schluppec » Fri, 10 Aug 2001 20:26:08



> Ok, so now I know the mantra of don't use absolute pathes in Tar
> files.  But I have one that I did that is and really need to restore it
> to another directory.  Any ideas how I can do this?

Hi,

cd /directory

tar cvfp - | (cd /newdirectory ; tar xfp -)

> Thanks.

> --
> Dipesh J. Hinduja
> Georgia Institute of Technology, Atlanta Georgia, 30332


--
Stefan Schluppeck -  Heinrich Bauer Produktions KG - D-20077 Hamburg
Publishing Support Center  -  Server & Concepts    - Burchardstr. 11

  sschluppeck.vcf
< 1K Download
 
 
 

Tar help

Post by Joerg Schilli » Sat, 11 Aug 2001 01:30:23




Quote:>> Ok, so now I know the mantra of don't use absolute pathes in Tar
>> files.  But I have one that I did that is and really need to restore it
>> to another directory.  Any ideas how I can do this?

>cd /directory

>tar cvfp - | (cd /newdirectory ; tar xfp -)

If you do this with Sun's tar and not with "star" you have a high risk
of creating a disaster by killing all files > 10k.

star is safe because it does not overwrite recent files from the
archive.

If you use other tar's you should call

tar cvfp - | (cd /newdirectory && tar xfp -)

--



URL:  http://www.fokus.gmd.de/usr/schilling    ftp://ftp.fokus.gmd.de/pub/unix

 
 
 

Tar help

Post by Markus Gyg » Sat, 11 Aug 2001 03:03:30




> > cd /directory
> tar cvfp - | (cd /newdirectory && tar xfp -)

Or maybe also:

cd /newdirectory &&
tar cvfp - -C /directory . | tar xfp -

Markus

 
 
 

Tar help

Post by Stefan Schluppec » Tue, 14 Aug 2001 16:01:50





> > > cd /directory
> > tar cvfp - | (cd /newdirectory && tar xfp -)

> Or maybe also:

> cd /newdirectory &&
> tar cvfp - -C /directory . | tar xfp -

> Markus

Thanks a lot. I have it note down.

schluppy
--
Stefan Schluppeck -  Heinrich Bauer Produktions KG - D-20077 Hamburg
Publishing Support Center  -  Server & Concepts    - Burchardstr. 11

 
 
 

1. tar help

Suppose i took the tar of a directory in such a way tar -cvf tarout.tar /sybase
how to extract single file from tar archive file?
Can we restore the files in the different directory what we had given
while taking the tar.

Thanks in advance
Sun

2. mush-7.2.5, Solaris 2.4 and NFS mail spool

3. TAR Help

4. ppp problems

5. tar help

6. Public Domain PPP for Solaris 2.3

7. Colors Question on X under Linux

8. BUG: 'tar +help' doesn't work with libc.so.4.4!!

9. TAR Help Please

10. .TAR help!!

11. unix tar help

12. More tar help