LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Thread Tools
Old 11-04-2009, 06:33 PM   #1
netpumber
Member
 
Registered: Sep 2007
Location: In My Box
Distribution: Sl@ckware 12.2
Posts: 192
Thanked: 0
a tar simple question


[Log in to get rid of this advertisement]
Hi guyz...

So listen at this..

I have a folder with images that is 4,3 Gb i run

tar -cvf /home/backup/pictures/pic.tar /home/net/pictures

and it creates the pic.tar file which is 4,3 Gb

I don't know why its the same size either zipped or unzziped . Anyway..i go to zipped one (pic.tar) and try to extract it right click extract here and returns me this error:

An error occurred while trying to open the archive

i press ok and then anoter message says:

An error occurred while opening the archive file:///home/backup/pictures/pic.tar.

Why this happens? how can i extract this tar now ?

Thanks..!!
linux netpumber is offline     Reply With Quote
Old 11-04-2009, 06:43 PM   #2
tuxdev
Senior Member
 
Registered: Jul 2005
Distribution: Slackware
Posts: 1,638
Thanked: 18
It's the same size because tar doesn't zip. That's gzip, bzip2, or xz's job. Tar also remembers the pathnames given to it, so it'll try to extract to /home/net/pictures no matter what.
Code:
tar cvzf pictures.tar.gz pictures

Last edited by tuxdev; 11-04-2009 at 06:45 PM..
windows_xp_2003 tuxdev is online now     Reply With Quote
Old 11-05-2009, 01:30 AM   #3
acummings
Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 441
Thanked: 9
be careful where you extract to ??

You not want to overwrite your /home/user do you ?

(I was on purpose try to overwrite /home/al)
I had prob in GUI (run level 4) couldn't extract a backup copy of /home/al -- couldn't extract and overwrite /home/al with a backup copy of /home/al

But then as root, did

telinit 3

command. Then I got the job done. But I *did overwrite /home/al* 1st I deleted /home/al then I restored /home/al from backup.
-------------

(you might try) To eliminate the overhead of the GUI

You might try in a terminal:

tar -xf pictures.tar

path relevant next

/home/user$ mkdir temp

/home/user$ cd temp

/home/user/temp$ ls
pictures.tar

/home/user/temp$ tar -xf pictures.tar

extracted path then is:

/home/user/temp/home/user/pictures

(not overwrites the /home/user in that way)

--
Alan.
linux acummings is offline     Reply With Quote
Old 11-05-2009, 01:38 AM   #4
acummings
Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 441
Thanked: 9
you didn't use z for zip option:

tar -czf pics.tar.gz ~/pics

(tar and gzipped all in one)

tar itself does not compress/zip

--
Alan.
linux acummings is offline     Reply With Quote
Old 11-05-2009, 02:09 AM   #5
acummings
Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 441
Thanked: 9
/home/user$

if pics is in that folder, ie

/home/user/pics

then if user is where at, ie

/home/user$ pwd
/home/user

/home/user$ tar -czf pics.tar.gz ./pics

*that* ( the ./ ) *might not* save the /home/user

IOW, *might* extract as pics folder without the /home/user on it.

but I don't recall for sure.

and it's late -- I already saw/noticed a very slight bit "off" my former post(s). (nothing harmful)- just maybe one folder off on path.

hope gets the point across <- what I posted should work for that.

--
Alan.
linux acummings is offline     Reply With Quote
Old 11-05-2009, 07:23 AM   #6
netpumber
Member
 
Registered: Sep 2007
Location: In My Box
Distribution: Sl@ckware 12.2
Posts: 192
Thanked: 0

Original Poster
So i do this :

cd /home/n3t
tar -czvf /media/disk/BACKUP/home/Pictures/$BACKUPDATE.tar.gz ./Pictures

After it creates the .tar.gz file i go to extract it with right click --> extract here.
And it says that i have no more free space..

But im sure that i have..
.tar.gz is 4.1 GB and the drive that it is in has 234Gb

Why this happens ? It try to extract it somewhere else maybe ?
linux netpumber is offline     Reply With Quote
Old 11-05-2009, 12:15 PM   #7
lumak
Member
 
Registered: Aug 2008
Location: Phoenix
Distribution: Slackware64
Posts: 361
Blog Entries: 19
Thanked: 24
where are you trying to extract it too?
linuxslackware lumak is offline     Reply With Quote
Old 11-05-2009, 12:38 PM   #8
disturbed1
Member
 
Registered: Mar 2005
Location: USA
Distribution: Slackware
Posts: 381
Thanked: 62
Quote:
Originally Posted by netpumber View Post

Why this happens ? It try to extract it somewhere else maybe ?
Read tuxdev's post. Tar stores paths.

cd /home/net
tar cfvz /some/place/backup.tar.gz pictures

tar..$OPTIONS.....$OUT-PUT-FILE........$DIRECTORY-OR-FILES-TO-TAR
without the .... of course

This will create a tar gzipped file containing only the directory pictures, and the files beneath it. When you extract the archive, it will create a directory pictures and populate that directory with the files.
linuxslackware disturbed1 is offline     Reply With Quote
Thanked by:
Old 11-05-2009, 01:55 PM   #9
netpumber
Member
 
Registered: Sep 2007
Location: In My Box
Distribution: Sl@ckware 12.2
Posts: 192
Thanked: 0

Original Poster
i can't understand what you say...

tar..$OPTIONS.....$OUT-PUT-FILE........$DIRECTORY-OR-FILES-TO-TAR

This is not the same with what i do..?

tar -czvf /media/disk/BACKUP/home/Pictures/$BACKUPDATE.tar.gz ./Pictures
linux netpumber is offline     Reply With Quote
Old 11-05-2009, 03:53 PM   #10
acummings
Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 441
Thanked: 9
BTW it's the same, what you did

IOW what U did is an actual usage example/incidince A.K.A. yes you *did do*:

tar..$OPTIONS.....$OUT-PUT-FILE........$DIRECTORY-OR-FILES-TO-TAR
--------------------------

option x extracts

if U did went to where you had put the backup then "extract here"

you'd then be extracting to a sub folder on /media/disk as next:

/media/disk/BACKUP/home/Pictures$ pwd
/media/disk/BACKUP/home/Pictures


/media/disk/BACKUP/home/Pictures$ ls
my_backup_DATE.tar.gz

/media/disk/BACKUP/home/Pictures$ tar -xzf my_backup_DATE.tar.gz


/media/disk/BACKUP/home/Pictures$ ls
Pictures
my_backup_DATE.tar.gz


/media/disk/BACKUP/home/Pictures$ cd Pictures

/media/disk/BACKUP/home/Pictures/Pictures$ ls
all_of_my_pictures_list_here



What is /media/disk ????

and how much room does it have ???

--
Alan.
linux acummings is offline     Reply With Quote
Thanked by:
Old 11-06-2009, 04:13 AM   #11
netpumber
Member
 
Registered: Sep 2007
Location: In My Box
Distribution: Sl@ckware 12.2
Posts: 192
Thanked: 0

Original Poster
Ok thanks acummings i understand now.. And it works..
linux netpumber is offline     Reply With Quote

Reply

Bookmarks


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Simple tar command sachinh Linux - General 4 07-10-2009 09:28 AM
simple tar question can not find answer in man file davimint Linux - General 3 05-22-2007 02:03 AM
a tough question 4 u, problem in extracting tar & tar.gz files p_garg Linux - General 4 04-04-2006 02:46 PM
Simple Tar Question otisthegbs Linux - Software 1 08-24-2004 02:47 PM
Probably a simple solution 2 a tar question Cruger Programming 6 03-23-2004 10:32 AM


All times are GMT -5. The time now is 02:59 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration