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 02-08-2010, 12:41 PM   #1
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6, CentOS 7 (with Mate), Ubuntu 16.04 Mate
Posts: 1,389

Rep: Reputation: 101Reputation: 101
Question Error while running tar


I am writing, well actually enhancing, a script to do a daily backup of important data on my PC to a second hard drive. I wish to tar my home directory to a single file - and will probably use gzip as well. So I decided to work out the correct tar syntax in a terminal first - here is what happened.

I opened a terminal window
I cd to a directory not part of my home directory
I issued the command
Quote:
tar -cvf mytar.tar /home/ken
tar processed a bunch of files, the last being .netrc and then displayed the following message
Quote:
tar: Exiting with failure status due to previous errors
I examined the tar file and it contains .netrc. The contents of .netrc are correct.

I scrolled back through the list of files in the terminal window and do not see any error messages.

I guess the question is... how do I determine what file tripped up the tar process?

TIA,

Ken
 
Old 02-08-2010, 01:23 PM   #2
amani
Senior Member
 
Registered: Jul 2006
Location: Kolkata, India
Distribution: Debian 64-bit GNU/Linux, Kubuntu64, Fedora QA, Slackware,
Posts: 2,766

Rep: Reputation: Disabled
ext4 related??

install the debuginfo package to see more clearly...gdb
 
Old 02-08-2010, 01:47 PM   #3
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6, CentOS 7 (with Mate), Ubuntu 16.04 Mate
Posts: 1,389

Original Poster
Rep: Reputation: 101Reputation: 101
Thanks for the quick reply amani. I am running all ext3 file systems so I do not think that is the issue.

Can you please tell me more about the debuginfo package. Is it available for Ubuntu - I do not find it in Synaptic nor do I find any debug packages associated with tar. I have googled for debuginfo and it appears to be a RedHat/Fedora package(?)

Ken
 
Old 02-08-2010, 01:57 PM   #4
amani
Senior Member
 
Registered: Jul 2006
Location: Kolkata, India
Distribution: Debian 64-bit GNU/Linux, Kubuntu64, Fedora QA, Slackware,
Posts: 2,766

Rep: Reputation: Disabled
the debuginfo packages are used with gnu debugger... but since you do not have ext4, then do not bother.

The problem is elsewhere
 
Old 02-08-2010, 02:20 PM   #5
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen, DK
Distribution: pclos2016, Slack14.1 Deb Jessie, + 50+ other Linux OS, for test only.
Posts: 16,276

Rep: Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154Reputation: 3154
.

Suggest : Do a separate 'tar -cvf' with the " .netrc "
files to test, what is happening.

.....
 
Old 02-08-2010, 02:42 PM   #6
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6, CentOS 7 (with Mate), Ubuntu 16.04 Mate
Posts: 1,389

Original Poster
Rep: Reputation: 101Reputation: 101
I just did a tar of my .netrc file as suggested. It worked fine, no error and the .netrc file is in the tar file as expected.

I am guessing that the file which caused the problem is the one which tar tried to process after .netrc. However, I have no idea what that file would be. Is tar reading files by timestamp, name alphabetically, inode number???

Ken
 
Old 02-08-2010, 02:49 PM   #7
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,275

Rep: Reputation: 370Reputation: 370Reputation: 370Reputation: 370
The tar command should tell you the error that occured (you may need to look back through the output). Usually this happens when a file changes or gets deleted while tar is trying to archive it. This is pretty common when archiving large directory and is nothing to worry about if that's what happened.
 
Old 02-08-2010, 04:10 PM   #8
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6, CentOS 7 (with Mate), Ubuntu 16.04 Mate
Posts: 1,389

Original Poster
Rep: Reputation: 101Reputation: 101
I have again looked line for line through the output. I see nothing to indicate a problem. I do note that the tar file is about 8.8 MB and my home directory is about 90 GB. I am not using compression so obviously the process is dying before processing all of the files under /home/ken.

That I have to worry about

Ken
 
Old 02-08-2010, 06:52 PM   #9
taylorkh
Senior Member
 
Registered: Jul 2006
Location: North Carolina
Distribution: CentOS 6, CentOS 7 (with Mate), Ubuntu 16.04 Mate
Posts: 1,389

Original Poster
Rep: Reputation: 101Reputation: 101
I changed my command thusly
Quote:
tar -cvf mytar.tar /home/ken 2> myerrors.txt
and the contents of myerrors.txt
Quote:
tar: Removing leading `/' from member names
tar: /home/ken/.viminfo: Cannot open: Permission denied
tar: Exiting with failure status due to previous errors
And the permissions on this rogue file .vminfo
Quote:
dr-x------ 2 ken ken 0 2010-02-06 16:42 .gvfs
So I did a sudo chmod 555 /home/ken/.viminfo and low and behold I can tar the whole mess. The resulting tar file is about 84 MB.

Ken
 
  


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
Error in TAR - tar: GNU features wanted on incompatible archive format. kuldeep.k Linux - General 3 08-14-2009 12:09 PM
Error: while running autospec on xxxxxxxx.tar.gz narendra1310 Linux - Software 2 06-15-2009 06:00 AM
error running rpmbuild -ta on cups source.tar.gz involving openssh? possible? Nahmus Linux - Software 6 04-14-2007 03:20 AM
Can anyone tell me what I need to do when running into a tar: Unexpected EOF error? schmootsypoo Linux - Software 2 09-03-2004 08:50 AM
problem unzipping a tar.bz2 file tar: Error is not recov jyome Linux - Software 4 09-04-2003 02:04 PM


All times are GMT -5. The time now is 12:43 AM.

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