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

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

--incremental extract with non-incremental archive wipes all


From: Jean-Francois Dockes
Subject: --incremental extract with non-incremental archive wipes all
Date: Fri, 9 Feb 2001 13:00:34 +0100 (MET)

When using the --incremental option with an archive that was not created
with --incremental or --listed-incremental (having no GNUTYPE_DUMPDIR
entries), the effect of a --incremental option is to wipe the whole
existing file tree.

It seems to me that this effect is undesirable. Only GNUTYPE_DUMPDIR
entries should be used to trim the directories. rm -rf is a more convenient
tool to cleanup a file tree. When the archive is not incremental, tar has
incomplete information about the directory state at archive time, so it
should not act on it.

I believe that the current code in extract.c : 

    case DIRTYPE:
    case GNUTYPE_DUMPDIR:
     [skip fragment]
      if (incremental_option)
        {
          /* Read the entry and delete files that aren't listed in the
             archive.  */

          gnu_restore (skipcrud);
        }
      else if (typeflag == GNUTYPE_DUMPDIR)
        skip_member ();

should be changed to:

    case DIRTYPE:
    case GNUTYPE_DUMPDIR:
     [skip fragment]
      if (typeflag == GNUTYPE_DUMPDIR)      
        {
          if (incremental_option)
            {
              /* Read the entry and delete files that aren't listed in the
                 archive.  */

              gnu_restore (skipcrud);
            }
          else 
            skip_member ();
        }


This might open the way to a version that would *not* dump *all* directory
contents during an incremental, which may be a serious waste of space in
some cases. 

I can't see any good reason to dump an unchanged directory (self unchanged
+ no changed children) during a non-full incremental backup, and other
backup tools don't do it (dump for example, but also most proprietary
backup software I believe). But this would be a more involved change of
course...

Maybe I'm missing something, in which case, I would be glad to be
enlightened :)

Jean-Francois Dockes




reply via email to

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