Linux - Server This forum is for the discussion of Linux Software used in a server related context. |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
01-03-2011, 09:29 PM
|
#1
|
LQ Newbie
Registered: Dec 2010
Posts: 14
Rep:
|
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
|
|
|
01-03-2011, 09:57 PM
|
#2
|
Senior Member
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824
|
What does "file file.tgz" return?
|
|
|
01-03-2011, 10:19 PM
|
#3
|
LQ Newbie
Registered: Dec 2010
Posts: 14
Original Poster
Rep:
|
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.
|
|
|
01-04-2011, 06:09 AM
|
#4
|
Senior Member
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824
|
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.
|
|
|
01-04-2011, 08:24 AM
|
#5
|
LQ Newbie
Registered: Dec 2010
Posts: 14
Original Poster
Rep:
|
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
|
|
|
01-04-2011, 08:34 AM
|
#6
|
Senior Member
Registered: Dec 2004
Location: Marburg, Germany
Distribution: openSUSE 15.2
Posts: 1,339
|
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?
|
|
|
01-04-2011, 09:11 AM
|
#7
|
Senior Member
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,824
|
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.
|
01-04-2011, 09:42 AM
|
#8
|
LQ Newbie
Registered: Dec 2010
Posts: 14
Original Poster
Rep:
|
Thanks Alucard
That worked
|
|
|
All times are GMT -5. The time now is 07:34 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|