LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Error untarring file (https://www.linuxquestions.org/questions/linux-newbie-8/error-untarring-file-658648/)

RexCoeus 07-27-2008 08:25 PM

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.

jschiwal 07-27-2008 08:36 PM

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.

RexCoeus 07-28-2008 11:11 AM

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.


All times are GMT -5. The time now is 03:29 PM.