Linux - NewbieThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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(?)
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???
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.