FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 02-25-2010, 04:15 PM
Mark Knecht
 
Default How to untar without first knowing the tar contents?

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
 
Old 02-25-2010, 04:21 PM
Willie Wong
 
Default How to untar without first knowing the tar contents?

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
 
Old 02-25-2010, 04:24 PM
Volker Armin Hemmann
 
Default How to untar without first knowing the tar contents?

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 ....
 
Old 02-25-2010, 05:13 PM
Neil Bothwick
 
Default How to untar without first knowing the tar contents?

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.
 
Old 02-25-2010, 05:18 PM
Florian Philipp
 
Default How to untar without first knowing the tar contents?

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
 

Thread Tools




All times are GMT. The time now is 05:37 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org