LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Tar error at XXX XXX X, code 1 - what is the meaning ? (https://www.linuxquestions.org/questions/linux-software-2/tar-error-at-xxx-xxx-x-code-1-what-is-the-meaning-625677/)

Robert S 03-04-2008 01:52 PM

Tar error at XXX XXX X, code 1 - what is the meaning ?
 
I have a regular backup script that runs every night. I regularly get the above error message when it runs. The tar command is
Quote:

tar -czvf $BACKFILE /etc /home /var/lib/samba > /dev/null 2>&1
This is a typical output:
Tar error at Wed Mar 5 03:21:33 EST 2008, code 1

What is the meaning of this, what can I do to get rid of it, and does it matter?

TIA.

bigrigdriver 03-04-2008 02:17 PM

I assume you run the tar to make a backup because it has meaning to you to do so. Therefore, any error in re running the tar backup does, by definition, matter.

Inspect your error logs in /var/log for entries at or near the time the error occurs. There may be useful information to solve the puzzle.

Robert S 03-04-2008 02:43 PM

The tar command backs up all of my users' files and a script stores them remotely on another PC.

There's nothing in the logs that helps.

Because the tar files are quite large its difficult to unpack them and inspect the contents. I have done so in the past and there doesn't appear to be a problem.

It would be difficult to debug a verbose output of the command because there are so many file backed up.

jschiwal 03-04-2008 03:01 PM

From the "info tar" manual:
Code:

  Possible exit codes of GNU `tar' are summarized in the following
table:

0
    `Successful termination'.

1
    `Some files differ'.  If tar was invoked with `--compare'
    (`--diff', `-d') command line option, this means that some files
    in the archive differ from their disk counterparts (*note
    compare::).  If tar was given `--create', `--append' or `--update'
    option, this exit code means that some files were changed while
    being archived and so the resulting archive does not contain the
    exact copy of the file set.

2
    `Fatal error'.  This means that some fatal, unrecoverable error
    occurred.

So while tar was backing up a file, it was modified.
You might want to look into --listed-incremental. They could result in smaller files and faster backups. Using --listed-incremental with create will create a timestamp file. On subsequent backups, only files modified since the last backup will be modified. See section 5.2 of the info manual for details.

bigrigdriver 03-04-2008 03:06 PM

One problem I've read of with tar backups and unidentified/unresolved errors is that, at some future time, a file which is seldom accessed is suddenly needed. The file name is in the system, but the file is empty. So, it may be worth your time to search your system for empty files. It should be safe to conclude that if there is an empty file in the system now, it's also empty in the backup.

Robert S 03-04-2008 03:19 PM

Thanks for your useful information. I store emails in /home/*/Maildir/ and I suspect that these are changing while the backup occurs. Maybe contents of /etc/ do as well. Does this sound plausible?

I prefer to do full backups every time. Makes for trouble-free restoration of files and I have enough storage and time to do them.

jschiwal 03-05-2008 05:19 AM

The file in /etc/ should be fairy static. A users Maildir might not be. The /var and /tmp directories are changed very frequently. ( /tmp shoudn't be backed up anyway ). If you have a database server running, you should use a database backup tool instead. If possible, backups should be performed in "init level 2" single user mode.

Robert S 03-06-2008 05:43 AM

I assume that all the files will be backed up even if an error 1 occurs. If I don't direct the output to /dev/null it still appears to get to the end of the backup. If the odd email arriving at this time doesn't get backed up I could probably live with it. There are no users using the machine at 3am.

Going into runlevel 2 seems a bit excessive for what I'm trying to achieve and results in the server being offline for a while. I believe that I could also use LVM to do a snapshot then back it up, but once again that's probably not necessary.


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