bug-tar
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-tar] Separate return code when file changes while being read


From: Sergey Poznyakoff
Subject: Re: [Bug-tar] Separate return code when file changes while being read
Date: Sat, 14 Oct 2006 14:13:55 +0300

Steve Bergman <address@hidden> wrote:

> If a file changes while tar is reading it, tar returns the same code as
> when there is a major problem like a tape write error.
> 
> This makes it unusable for automated nightly backups.  It is perfectly
> reasonable to want to include, for example, log files in the backup,
> which might be appended to while being read.

If the file is appended, tar exits with zero exit code. Try this test:

COUNT=100000
dd if=/dev/zero of=file count=$COUNT 
dd if=/dev/zero of=file count=$COUNT seek=$COUNT &
tar cf archive file
echo $?

It gives:

tar: file: file changed as we read it
0

However, if the file is trucated, tar exits with status 2, indeed.

> Certainly, it is reasonable to return a nonzero code in the case that a
> file changes while being read, but it should not be the *same* nonzero
> code as for more serious problems.

Yes, I agree with that.

Regards,
Sergey




reply via email to

[Prev in Thread] Current Thread [Next in Thread]