LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 01-03-2011, 09:29 PM   #1
boomer42812
LQ Newbie
 
Registered: Dec 2010
Posts: 14

Rep: Reputation: 0
Unable to decompress tgz backup file


I have recently upgraded to Bugzilla3 and I wanted to restore my bugzilla database with my backup but when I attempt to tar -xvvzf file.tgz I get the error

gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error exit delayed from previous errors

My script that creates the backup is:

#!/bin/sh
datestr=`date +%m-%d-%Y`
bakdirpart="bugzilla.backup.$datestr"
bakdir="$HOME/$bakdirpart"
mkdir "$bakdir"

(cd /etc; tar cvzf $bakdir/mysql.conf.tgz mysql)
(cd /etc; tar cvzf $bakdir/apache2.conf.tgz apache2)
(cd /usr/share; tar cvzf $bakdir/bzreport.share.tgz bzreport)
(cd /usr/share; tar cvzf $bakdir/bugzilla.share.tgz bugzilla)
(cd /var/lib; tar cvzf $bakdir/mysql.hotdb.tgz mysql)
(cd /var; tar cvzf $bakdir/www.tgz www)
(cd "$HOME"; tar cvf "${bakdir}.tar" "$bakdirpart")

Is there any way to recover my backup copy?

Thanks for any assistance anyone can provide
 
Old 01-03-2011, 09:57 PM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
What does "file file.tgz" return?
 
Old 01-03-2011, 10:19 PM   #3
boomer42812
LQ Newbie
 
Registered: Dec 2010
Posts: 14

Original Poster
Rep: Reputation: 0
it returned:

code:

140:~# file bugzilla.backup.01-03-2011.tgz

Output:

bugzilla.backup.01-03-2011.tgz: POSIX tar archive (GNU)

Last edited by boomer42812; 01-03-2011 at 10:20 PM.
 
Old 01-04-2011, 06:09 AM   #4
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
So it's a tar archive that never got gzipped despite the name you gave it. Just untar it, don't try to ungzip it.
 
Old 01-04-2011, 08:24 AM   #5
boomer42812
LQ Newbie
 
Registered: Dec 2010
Posts: 14

Original Poster
Rep: Reputation: 0
Thanks for the quick response Alucard

I don't know anything about tar. I reviewed the man page for tar but I can't seem to figure out what command to use that will untar a file. I tried the following

Code:
tar -Zxvf bugzilla.backup.01-03-2011

Output:
140:~# tar -Zxvf bugzilla.backup.12-03-2010.tgz
tar: compress: Cannot exec: No such file or directory
tar: Error is not recoverable: exiting now
tar: Child returned status 2
tar: Error exit delayed from previous errors


I also tried

Code:
tar -zxvf bugzilla.backup.01-03-2011

Output:

gzip: stdin: not in gzip format
tar: Child returned status 1
tar: Error exit delayed from previous errors

What am I missing?

Thanks again for your help
 
Old 01-04-2011, 08:34 AM   #6
Reuti
Senior Member
 
Registered: Dec 2004
Location: Marburg, Germany
Distribution: openSUSE 15.2
Posts: 1,339

Rep: Reputation: 260Reputation: 260Reputation: 260
One remark for the readability of the script: you can use the option -C (uppercase) followed by a directoryname instead of creating the subshells. To the original problem: you used -v there: what was the output during the creation of the archive?
 
Old 01-04-2011, 09:11 AM   #7
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824

Rep: Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615Reputation: 615
Again, your tar file is not compressed! So don't try to decompress it.

Try: tar xvf bugzilla.backup.12-03-2010.tgz
 
1 members found this post helpful.
Old 01-04-2011, 09:42 AM   #8
boomer42812
LQ Newbie
 
Registered: Dec 2010
Posts: 14

Original Poster
Rep: Reputation: 0
Thanks Alucard

That worked
 
  


Reply



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
decompress .dat file cccc Linux - Software 3 12-30-2009 07:04 PM
How can I decompress this .tar file? okonita Linux - Newbie 3 06-14-2008 06:34 AM
I can't decompress a file combilli Linux - Software 4 10-21-2006 12:48 AM
tgz file doesn't end in .tgz? detpenguin Slackware 4 05-15-2004 07:13 PM
how to decompress file from diskette william43 Linux - Newbie 9 07-09-2003 11:44 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 01:58 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration