LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


Reply
  Search this Thread
Old 07-27-2008, 09:25 PM   #1
RexCoeus
Member
 
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 HOME DIRECTORY --EXCLUDE .GVFS FOLDER

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

# SCP BACKUP FILE TO SERVER

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



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

Rep: Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670
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, 12:11 PM   #3
RexCoeus
Member
 
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.
 
  


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



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


All times are GMT -5. The time now is 10:30 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration