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

Notices

Reply
 
LinkBack Search this Thread
Old 11-04-2009, 05:33 PM   #1
netpumber
Member
 
Registered: Sep 2007
Location: In My Box
Distribution: Gentoo
Posts: 307

Rep: Reputation: 31
a tar simple question


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..!!
 
Old 11-04-2009, 05:43 PM   #2
tuxdev
Senior Member
 
Registered: Jul 2005
Distribution: Slackware
Posts: 1,994

Rep: Reputation: 107Reputation: 107
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 05:45 PM.
 
Old 11-05-2009, 12:30 AM   #3
acummings
Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 602

Rep: Reputation: 44
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.
 
Old 11-05-2009, 12:38 AM   #4
acummings
Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 602

Rep: Reputation: 44
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.
 
Old 11-05-2009, 01:09 AM   #5
acummings
Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 602

Rep: Reputation: 44
/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.
 
Old 11-05-2009, 06:23 AM   #6
netpumber
Member
 
Registered: Sep 2007
Location: In My Box
Distribution: Gentoo
Posts: 307

Original Poster
Rep: Reputation: 31
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 ?
 
Old 11-05-2009, 11:15 AM   #7
lumak
Member
 
Registered: Aug 2008
Location: Phoenix
Distribution: Arch
Posts: 799
Blog Entries: 32

Rep: Reputation: 108Reputation: 108
where are you trying to extract it too?
 
Old 11-05-2009, 11:38 AM   #8
disturbed1
Senior Member
 
Registered: Mar 2005
Location: USA
Distribution: Slackware
Posts: 1,108
Blog Entries: 6

Rep: Reputation: 195Reputation: 195
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.
 
Old 11-05-2009, 12:55 PM   #9
netpumber
Member
 
Registered: Sep 2007
Location: In My Box
Distribution: Gentoo
Posts: 307

Original Poster
Rep: Reputation: 31
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
 
Old 11-05-2009, 02:53 PM   #10
acummings
Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 602

Rep: Reputation: 44
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.
 
Old 11-06-2009, 03:13 AM   #11
netpumber
Member
 
Registered: Sep 2007
Location: In My Box
Distribution: Gentoo
Posts: 307

Original Poster
Rep: Reputation: 31
Ok thanks acummings i understand now.. And it works..
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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


All times are GMT -5. The time now is 06:45 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
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration