horrible problem with .tgz backups

Ask questions about dedicated servers here and we and other users will do our best to answer them. Please also refer to the self-help section for tutorials and answers to the most commonly asked questions.
WoAyumi
A regular
A regular
Posts: 52
https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
Joined: Sat Apr 28, 2012 6:24 pm

horrible problem with .tgz backups

Post by WoAyumi »

Dear NFO,

I have a horrible problem with all my backups. All archives are broken. I am receiving all kinds of errors on different archives:

I need help to restore at least one archive. Help!

error1:
tar: Skipping to next header
tar: Exiting with failure status due to previous errors

error2:
gzip: stdin: invalid compressed data--format violated
tar: Unexpected EOF in archive
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now
Hot Carl
A semi-regular
A semi-regular
Posts: 28
Joined: Sat Mar 24, 2012 6:23 am

Re: horrible problem with .tgz backups

Post by Hot Carl »

What commands are you using to tar?

Carl
WoAyumi
A regular
A regular
Posts: 52
Joined: Sat Apr 28, 2012 6:24 pm

Re: horrible problem with .tgz backups

Post by WoAyumi »

Code: Select all

#!/bin/sh
FILENAME=bak-World2-$(date +%Y%m%d-%H%M).tgz
cd /mc/worlds
nice -n 5 tar czvfsp $FILENAME /mc/worlds/World2
mv /home/mc/worlds/$FILENAME /spinner/bak/World2/$FILENAME
exit $?
Hot Carl
A semi-regular
A semi-regular
Posts: 28
Joined: Sat Mar 24, 2012 6:23 am

Re: horrible problem with .tgz backups

Post by Hot Carl »

Pull the z out or use tar -zcvf, or just use tar -cvf

See if that works.

Carl
Hot Carl
A semi-regular
A semi-regular
Posts: 28
Joined: Sat Mar 24, 2012 6:23 am

Re: horrible problem with .tgz backups

Post by Hot Carl »

Hot Carl wrote:Pull the z out or use tar -zcvf, or just use tar -cvf

See if that works.

Carl
Oh wait not sure if it matters or not, but there might be an issue with the .tgz extension. I think that you have to use the "z" with the .tgz extension. Is there any reason why it can't be .tar?

Carl
Hot Carl
A semi-regular
A semi-regular
Posts: 28
Joined: Sat Mar 24, 2012 6:23 am

Re: horrible problem with .tgz backups

Post by Hot Carl »

I can't edit my posts, sorry for the 3 posts in a row but you need to use tar -zcvf that will compress to extract it you would use tar -zxvf.

Carl
WoAyumi
A regular
A regular
Posts: 52
Joined: Sat Apr 28, 2012 6:24 pm

Re: horrible problem with .tgz backups

Post by WoAyumi »

I'm using zxvf to extract. It does not help. What should I do with those backups? They all showing errors.
Why is this happening? What caused these problems?
User avatar
Edge100x
Founder
Founder
Posts: 13111
Joined: Thu Apr 18, 2002 11:04 pm
Location: Seattle
Contact:

Re: horrible problem with .tgz backups

Post by Edge100x »

Are you certain that there weren't errors when the backups were created?
WoAyumi
A regular
A regular
Posts: 52
Joined: Sat Apr 28, 2012 6:24 pm

Re: horrible problem with .tgz backups

Post by WoAyumi »

How can I be? It's an automatic script, that initiates by itself.

How can I restore at least one archive? Help. How to not make sure, this will not happen again?
User avatar
Edge100x
Founder
Founder
Posts: 13111
Joined: Thu Apr 18, 2002 11:04 pm
Location: Seattle
Contact:

Re: horrible problem with .tgz backups

Post by Edge100x »

Automatic scripts normally have their output to an email (when run via a crontab) or log. Did you also not test the script before you started automating it, though? That is not good.

I do not know ways of recovering from the errors that you are seeing.
WoAyumi
A regular
A regular
Posts: 52
Joined: Sat Apr 28, 2012 6:24 pm

Re: horrible problem with .tgz backups

Post by WoAyumi »

Edge100x, where are these logs, normally, in debian?
Yes, I am using crontab.
User avatar
Edge100x
Founder
Founder
Posts: 13111
Joined: Thu Apr 18, 2002 11:04 pm
Location: Seattle
Contact:

Re: horrible problem with .tgz backups

Post by Edge100x »

Run via crontab, you should normally see output emailed to your local root@machine account.
WoAyumi
A regular
A regular
Posts: 52
Joined: Sat Apr 28, 2012 6:24 pm

Re: horrible problem with .tgz backups

Post by WoAyumi »

Where exactly this file can be found, by default? I'm sorry.
WoAyumi
A regular
A regular
Posts: 52
Joined: Sat Apr 28, 2012 6:24 pm

Re: horrible problem with .tgz backups

Post by WoAyumi »

this is, what I was able to find:

Code: Select all

Jul 28 12:00:01 ispconfig /USR/SBIN/CRON[31964]: (root) CMD (/mc/bak-World2.sh #World2 bak)
Jul 28 12:06:15 ispconfig /USR/SBIN/CRON[31958]: (CRON) error (grandchild #31962 failed with exit status 1)
Can this help to find out, what was the cause of corrupted archives? Is this information helpful?
User avatar
Edge100x
Founder
Founder
Posts: 13111
Joined: Thu Apr 18, 2002 11:04 pm
Location: Seattle
Contact:

Re: horrible problem with .tgz backups

Post by Edge100x »

That suggests there was an error, but doesn't indicate what it was. You could likely replicate it by running your backup script manually. But, it will still likely be difficult or impossible to recover an old and broken backup, even with that information =\.
Post Reply