Where is GNU tar -g (--listed-incremental) documented?

Where is GNU tar -g (--listed-incremental) documented?

Post by Daniel S. Barcl » Tue, 06 Jun 1995 04:00:00

Does anyone know how new listed incremental backups (the -g or --listed-
incremental option) are supposed to work in GNU tar?

Exploring it with test data (a few directories), I thought I had figured out
how to use it.  However, when I use it for real (on my whole directory tree),
it doesn't work.

To create a full backup to be suitable as the basis for incremental backup,
I run tar with the -g option, giving a non-existent file name.  On test
data, this appears to work fine:  tar copies all files to tape, and creates a
tar data file containing one line with some number (a time, I assume) plus one
line for each subdirectory (the subdirectory name plus two numbers, I have
no idea what).

To incrementally back up changes, I run tar again with the -g option, giving
the name of the tar data file created above.  Again, this works fine on test
data.  (That is, it seems to back yp only new or changed files.)

However, when I try to back up for real, tar doesn't create the tar data file
correctly.  I get a data file containing only the first line (the apparent
timestamp); no directories are listed.  Then when I try to do an incremental
backup, it starts backing up everything again (apparently, because nothing is
listed in the data file as having been backed up already).

(I don't think this is a tar bug, because it has worked before on real data.)

Does anyone know how the GNU tar listed incremental backups feature works
and how it is intended to be used?

I'd RTFM if there were any f***ing documentation, but at least on Slackware
2.1 (Morse Tel. CD) the documentation sucks:  The manual page says only:

        -g, --listed-incremental F
                create/list/extract   new   GNU-format  incremental backup.

and info page is out of date - it doesn't even list the -g option (only an
older -G option).

Even for old incremental backups, though the out-of-date info. page does
explain the purpose and some of the mechanism of old incremental backups,
it never explains _how_ to use tar to do them.  (That is, what to do with the
data file:  what to do to do a full backup, what to do to do an increment
based on a full backup, what to do to do an increment based on the previous
increment, etc.)

(Please also e-mail any response.  I'll be away from news for a while.)

Daniel S. Barclay       Compass Design Automation, Inc.

        "They listen hard, and act like they care.
         How can they be so completely unaware
         Of the truth?  The answer is always denied me
         So I introduce 'em to the killer inside me." - MC 900 Ft. Jesus


1. GNU tar --(listed-)incremental

I would be surprised if this is really the case, as if I recall
correctly, rename() is guaranteed to be atomic (by POSIX?) and so
can't be implemented with two syscalls.  However, that doesn't prevent
the filesystem changing the ctime for rename.

A reading of the manpage for Linux actually does not bear me out:-

       If  newpath already exists it will be atomically overwrit-
       ten (subject to a few conditions - see ERRORS  below),  so
       that there is no point at which another process attempting
       to access newpath will find it missing.

       If newpath exists but the operation fails for some  reason
       or  the  system  crashes  rename  guarantees  to  leave an
       instance of newpath in place.

       However, when overwriting there will probably be a  window
       in  which both oldpath and newpath refer to the file being

...so I may well be wrong.

Well, the mtime on the directory changes:-

drwxr-xr-x   2 james    wheel        1024 Thu Jun 12 14:20:45 1997 .
-rw-r--r--   1 james    wheel           0 Thu Jun 12 14:20:45 1997 foo

Thu Jun 12 14:20:53 BST 1997

drwxr-xr-x   2 james    wheel        1024 Thu Jun 12 14:20:57 1997 .
-rw-r--r--   1 james    wheel           0 Thu Jun 12 14:20:45 1997 bar

2. Horroracle Install...

3. How to restore an incremental backup made with gnu tar (without timestamp like named dirs) ?

4. PCI network card remote boot into mars-nwe

5. incremental backups with GNU-tar

6. solaris 2.6 sendmail problem

7. GNU tar incremental backups?

8. Delete last character in a line

9. GNU tar: --listed meaning?

10. tar/gnu tar question

11. tar/gnu tar failing to append

12. rsh, rcp, GNU tar cvf user@host:./tarfile.tar file FAIL

13. GNU tar -M not compatible with SVR4 tar -k?