bug-gnu-utils
[Top][All Lists]
Advanced

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

Re: gnu tar w/ --listed-incremental --files-from


From: Stepan Kasal
Subject: Re: gnu tar w/ --listed-incremental --files-from
Date: Tue, 28 Jan 2003 12:20:41 +0100
User-agent: Mutt/1.2.5.1i

Hi,

On Tue, Jan 28, 2003 at 11:31:15AM +0100, Miek Gieben wrote:
> But now I don't seem to understand my own bug report :) 

:-)  I know the feeling.

> when there is --listed-incremental file tar should backup everything in
> --files-from. If there is a --listed-incremental tar should look at that file,
> and only that file. And backup everything that is newer or did not existed
> before?

I beleive you meant "when there is no --listed-incremental file" at the very
beginning.

Anyway, I'd answer this way (be patient, please :-):

When you call

        tar cf file.tar /this/path /that/path ...

tar creates file.tar containing all subtrees listed as arguments.

Instead of listing the files/paths on command line, you can put them in
a file and use --files-from, so that the command line is more readable.
You can even combine both methods.

But it's not important whether the files have been named directly on the
command line or indirectly via --files-from.  I'll simply call it ``given
files,'' meaning the union of the files listed on cmdline and via any
--files-from.

Well, now we can proceed to incremental backups.

Forget about option --incremental, it was a mistake, I beleive.
(BTW: When you read the sources, it's important to remember that some
branches of code should be almost ignored, I think its
        (incremental_option && !listed_incremental_option).)

For incremental backups you call eg.:

        tar cf file.tar --listed-incremental=/save/to/a/file \
                /this/path /that/path ...

when you run it for the first time, it creates the file ``/save/to/a/file''
which, in general, is in a special format and should not be read nor
modified by mere mortals.

When you run _exactly the same command_ a day or two later, a files which
has been modified (another date, another size, ...) or which newly appeared
are included in todays backup.

So I'd say that the list of ``given files'' should be the same, in fact the
whole command line and contents of --files-from should be exactly the same.
Then tar adapts to the changes which happened from the last run.
If the command line has changed, let's suppose that the tar behaviour is
undefined.  (At least in this level of the game.)

Even if we stay within the outlined boundaries, we may encounter a few bugs:

1) If the list of ``given files'' contains a regular file, this file is
   backed up each time the command is run.

   Workaround: if you need incremental backup of individual files, either
        check the timestamp manualy, or use stub directories.

   In any case, accept the following rule: the list of ``given files'' for
        an incremental backup should contain only directory names.

2) If the list of given files contains mountpoints and option
   --one-filesystem is given, some the mountpoints may not be included.
   Example: tar ... --one-filesystem / /var
   tar remembers to skip /var as it doesn't belong to the root filesystem
   and the fact that it's explicitly mentioned later doesn't help.

   Fix: use the patch I've mentioned before.

Conclusion:
start with patterns which are known to work and carefully extend your
territorium.  When you find a place where lions live, either conquer over
them, or be careful not to enter that spot again...

And don't hesitate to write reports about any animal you meet.

Have a nice day,
        Stepan Kasal




reply via email to

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