public inbox for gentoo-user@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-user] How to untar without first knowing the tar contents?
@ 2010-02-25 17:15 Mark Knecht
  2010-02-25 17:21 ` Willie Wong
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Mark Knecht @ 2010-02-25 17:15 UTC (permalink / raw
  To: gentoo-user

Hi,
   I backed up my wife's home directory using tar in preparation to
moving her to a new machine but I don't remember the exact command I
used to do the tar command. When I tried to untar on the new machine
it failed to do anything. (except use 30 minutes of CPU time...)

MacMini home # tar -xjf /mnt/cdrom/evelyn.20100214.tar.bz2 /home/evelyn/
tar: /home/evelyn: Not found in archive
tar: Error exit delayed from previous errors
MacMini home #

I'm currently running

tar -tz /mnt/cdrom/evelyn.20100214.tar.bz2

and it's been going 15 minutes without writing anything to the screen.
I assume that I need to list the contents of the tar file to figure
out how to untar but I'm really not sure.

   How do I best proceed?

Thanks,
Mark



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-user] How to untar without first knowing the tar contents?
  2010-02-25 17:15 [gentoo-user] How to untar without first knowing the tar contents? Mark Knecht
@ 2010-02-25 17:21 ` Willie Wong
  2010-02-25 17:24 ` Volker Armin Hemmann
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Willie Wong @ 2010-02-25 17:21 UTC (permalink / raw
  To: gentoo-user

On Thu, Feb 25, 2010 at 09:15:47AM -0800, Mark Knecht wrote:
> MacMini home # tar -xjf /mnt/cdrom/evelyn.20100214.tar.bz2 /home/evelyn/
> tar: /home/evelyn: Not found in archive

You need the -C flag. See man tar. 

W
-- 
Willie W. Wong                                     wwong@math.princeton.edu
Data aequatione quotcunque fluentes quantitae involvente fluxiones invenire 
         et vice versa   ~~~  I. Newton



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-user] How to untar without first knowing the tar contents?
  2010-02-25 17:15 [gentoo-user] How to untar without first knowing the tar contents? Mark Knecht
  2010-02-25 17:21 ` Willie Wong
@ 2010-02-25 17:24 ` Volker Armin Hemmann
  2010-02-25 18:13 ` Neil Bothwick
  2010-02-25 18:18 ` Florian Philipp
  3 siblings, 0 replies; 6+ messages in thread
From: Volker Armin Hemmann @ 2010-02-25 17:24 UTC (permalink / raw
  To: gentoo-user

On Donnerstag 25 Februar 2010, Mark Knecht wrote:
> Hi,
>    I backed up my wife's home directory using tar in preparation to
> moving her to a new machine but I don't remember the exact command I
> used to do the tar command. When I tried to untar on the new machine
> it failed to do anything. (except use 30 minutes of CPU time...)
> 
> MacMini home # tar -xjf /mnt/cdrom/evelyn.20100214.tar.bz2 /home/evelyn/
> tar: /home/evelyn: Not found in archive
> tar: Error exit delayed from previous errors
> MacMini home #
> 
> I'm currently running
> 
> tar -tz /mnt/cdrom/evelyn.20100214.tar.bz2
> 
> and it's been going 15 minutes without writing anything to the screen.
> I assume that I need to list the contents of the tar file to figure
> out how to untar but I'm really not sure.
> 
>    How do I best proceed?
> 
> Thanks,
> Mark

a different kernel?
I had a problem with systemresucecd a couple of weeks ago. Unpacking a tar file 
with multi gb size took more than an hour - for 300mb.

I booted into my backup gentoo where untarring the whole thing took less ....



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-user] How to untar without first knowing the tar contents?
  2010-02-25 17:15 [gentoo-user] How to untar without first knowing the tar contents? Mark Knecht
  2010-02-25 17:21 ` Willie Wong
  2010-02-25 17:24 ` Volker Armin Hemmann
@ 2010-02-25 18:13 ` Neil Bothwick
  2010-02-25 18:18 ` Florian Philipp
  3 siblings, 0 replies; 6+ messages in thread
From: Neil Bothwick @ 2010-02-25 18:13 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 496 bytes --]

On Thu, 25 Feb 2010 09:15:47 -0800, Mark Knecht wrote:

> tar -tz /mnt/cdrom/evelyn.20100214.tar.bz2
> 
> and it's been going 15 minutes without writing anything to the screen.
> I assume that I need to list the contents of the tar file to figure
> out how to untar but I'm really not sure.

tar tvf archivename

Don't specify the compression type, let tar work it out for itself.


-- 
Neil Bothwick

With 5 billion people on earth chances are slim it will ever be *your*
day.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-user] How to untar without first knowing the tar contents?
  2010-02-25 17:15 [gentoo-user] How to untar without first knowing the tar contents? Mark Knecht
                   ` (2 preceding siblings ...)
  2010-02-25 18:13 ` Neil Bothwick
@ 2010-02-25 18:18 ` Florian Philipp
  2010-02-25 19:42   ` Mark Knecht
  3 siblings, 1 reply; 6+ messages in thread
From: Florian Philipp @ 2010-02-25 18:18 UTC (permalink / raw
  To: gentoo-user

[-- Attachment #1: Type: text/plain, Size: 1852 bytes --]

Mark Knecht schrieb:
> Hi,
>    I backed up my wife's home directory using tar in preparation to
> moving her to a new machine but I don't remember the exact command I
> used to do the tar command. When I tried to untar on the new machine
> it failed to do anything. (except use 30 minutes of CPU time...)
> 
> MacMini home # tar -xjf /mnt/cdrom/evelyn.20100214.tar.bz2 /home/evelyn/
> tar: /home/evelyn: Not found in archive
> tar: Error exit delayed from previous errors
> MacMini home #
> 
> I'm currently running
> 
> tar -tz /mnt/cdrom/evelyn.20100214.tar.bz2
> 
> and it's been going 15 minutes without writing anything to the screen.
> I assume that I need to list the contents of the tar file to figure
> out how to untar but I'm really not sure.
> 
>    How do I best proceed?
> 
> Thanks,
> Mark
> 

Err, your tar commands are a bit wrong.

tar -xjf /mnt/cdrom/evelyn.20100214.tar.bz2 /home/evelyn/
tells tar to extract the parts of it which are under home/evelyn to the
working directory.
This might be what you wanted in the first place but I guess you rather want
tar -xjf /mnt/cdrom/evelyn.20100214.tar.bz2 -C /home/evelyn/
which means extracting the complete content of the tar file to /home/evelyn.

Your second command ... well, where to start:
1. Since you didn't use the -f switch (as you did correctly in the first
command), tar expects input from stdin, not as a file specified on
commandline. That's why it hasn't done anything in the last 15 minutes.

2. With -z you specify that the file is compressed with gzip but the
file ending shows its compressed with bzip2. That's the -j switch
(again, correct in your first command).

By the way: You should enable the -p switch when extracting the files in
order to restore permissions and so forth.

Hope this helps!
Florian Philipp


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 261 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [gentoo-user] How to untar without first knowing the tar  contents?
  2010-02-25 18:18 ` Florian Philipp
@ 2010-02-25 19:42   ` Mark Knecht
  0 siblings, 0 replies; 6+ messages in thread
From: Mark Knecht @ 2010-02-25 19:42 UTC (permalink / raw
  To: gentoo-user

On Thu, Feb 25, 2010 at 10:18 AM, Florian Philipp
<lists@f_philipp.fastmail.net> wrote:
> Mark Knecht schrieb:
>> Hi,
>>    I backed up my wife's home directory using tar in preparation to
>> moving her to a new machine but I don't remember the exact command I
>> used to do the tar command. When I tried to untar on the new machine
>> it failed to do anything. (except use 30 minutes of CPU time...)
>>
>> MacMini home # tar -xjf /mnt/cdrom/evelyn.20100214.tar.bz2 /home/evelyn/
>> tar: /home/evelyn: Not found in archive
>> tar: Error exit delayed from previous errors
>> MacMini home #
>>
>> I'm currently running
>>
>> tar -tz /mnt/cdrom/evelyn.20100214.tar.bz2
>>
>> and it's been going 15 minutes without writing anything to the screen.
>> I assume that I need to list the contents of the tar file to figure
>> out how to untar but I'm really not sure.
>>
>>    How do I best proceed?
>>
>> Thanks,
>> Mark
>>
>
> Err, your tar commands are a bit wrong.
>
> tar -xjf /mnt/cdrom/evelyn.20100214.tar.bz2 /home/evelyn/
> tells tar to extract the parts of it which are under home/evelyn to the
> working directory.
> This might be what you wanted in the first place but I guess you rather want
> tar -xjf /mnt/cdrom/evelyn.20100214.tar.bz2 -C /home/evelyn/
> which means extracting the complete content of the tar file to /home/evelyn.
>
> Your second command ... well, where to start:
> 1. Since you didn't use the -f switch (as you did correctly in the first
> command), tar expects input from stdin, not as a file specified on
> commandline. That's why it hasn't done anything in the last 15 minutes.
>
> 2. With -z you specify that the file is compressed with gzip but the
> file ending shows its compressed with bzip2. That's the -j switch
> (again, correct in your first command).
>
> By the way: You should enable the -p switch when extracting the files in
> order to restore permissions and so forth.
>
> Hope this helps!
> Florian Philipp
>
>
Wow! I'm really bad! I didn't get that about stdin at all. Never
dawned on me... Stupid me...

Thanks Florian!

OK, using Neil's suggestion

tar tfv archivername

results in the first few lines:

MacMini ~ # tar tvf /mnt/cdrom/evelyn.20100214.tar.bz2
drwx------ evelyn/users      0 2010-02-13 14:50 home/evelyn/
drwx------ evelyn/users      0 2008-04-11 17:33 home/evelyn/.AbiSuite/
-rw-r--r-- evelyn/users   2614 2008-07-24 01:18
home/evelyn/.AbiSuite/AbiWord.Profile
drwxr-xr-x evelyn/users      0 2010-02-12 19:21 home/evelyn/.xine/
drwxr-xr-x evelyn/users      0 2007-09-19 13:36 home/evelyn/.xine/cddbcache/
-rw-r--r-- evelyn/users    761 2007-09-19 13:36 home/evelyn/.xine/cddbcache/5e0

so I tried

tar xfv /mnt/cdrom/evelyn.20100214.tar.bz2 -C /

and because /home/evelyn already exists the files seemed to  end up in
the right place.


Thanks,
Mark



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-02-25 20:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-02-25 17:15 [gentoo-user] How to untar without first knowing the tar contents? Mark Knecht
2010-02-25 17:21 ` Willie Wong
2010-02-25 17:24 ` Volker Armin Hemmann
2010-02-25 18:13 ` Neil Bothwick
2010-02-25 18:18 ` Florian Philipp
2010-02-25 19:42   ` Mark Knecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox