Welcome to the most active Linux Forum on the web.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 07-27-2008, 08:25 PM   #1
Registered: Jul 2007
Location: Cantina on Mos Eisley
Distribution: Slackware, Ubuntu
Posts: 39

Rep: Reputation: 15
Error untarring file

I am writing a simple backup script where I tar my home directory to a tmp file and then scp it to my file server. When untarring the file/directory on my server I receive these error messages:

gzip: stdin: unexpected end of file
tar: Unexpected EOF in archive
tar: Unexpected EOF in archive
tar: Error is not recoverable: exiting now

I was able to untar this file/directory on my desktop with no errors. Any idea's as to why I would receive the error on the file server. Here is the script:

day=$(date +%b%d)


tar czf /tmp/backup.$day.tgz /home/coeus --exclude .gvfs


scp /tmp/backup.$day.tgz server:/home/coeus/backups

Thanks for any help.
Old 07-27-2008, 08:36 PM   #2
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671Reputation: 671
Look at the backup file with the file command. Look at the long listing. Since you copied it, the original is still in the /tmp directory. Can you list the contents of either? Do the sizes match? Are you using compatible versions of tar? For example, if you tar'ed the file with a gnu tar but on the destination computer, you have a non-gnu version, I don't know if the format would be compatible. Also, did you remember the -z option when trying to extract the files? If you didn't you would see a similar result.
Old 07-28-2008, 11:11 AM   #3
Registered: Jul 2007
Location: Cantina on Mos Eisley
Distribution: Slackware, Ubuntu
Posts: 39

Original Poster
Rep: Reputation: 15
I think I found my problem. After tinkering for a bit, I saw an error message prompting that the file date/time was in the future... my server's clock was about 3 hours behind. I set up my server to get its time from a ntp server, and now the files untar properly. Interesting. Thanks for your help.


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
archive file UID's after untarring nmolinos Linux - Software 2 04-13-2005 12:00 AM
An error in untarring a file ? gopikrish Linux - Software 2 08-20-2004 07:06 PM
Untarring files????? caleb star Linux - Newbie 3 02-03-2004 08:28 AM
Stupid question- Untarring a file? randon Linux - General 4 11-10-2003 02:42 PM
Untarring to another directory adz Linux - Software 5 07-18-2003 10:09 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 11:46 PM.

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