bug-fileutils
[Top][All Lists]
Advanced

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

fileutils `snapshot' extension


From: Russell Senior
Subject: fileutils `snapshot' extension
Date: 15 May 2001 17:53:45 -0700

I have been working on an extension to GNU fileutils that will let me
make space-minimal[1] read-only snapshots of a directory hierarchy.
The basic design of the program, tentatively named `snapshot', is as
follows:

> program takes a srcdir, targetdir and (optionally) a relativedir as
  arguments;

> recursively descends srcdir, recreating in targetdir directories and
  other special files (mknod(), mkfifo(), etc), but for regular files
  comparing the srcdir file against pre-existing version in
  relativedir and if it is `the same', then create a hard link in
  targetdir to the relativedir version (it is assumed in this that
  relativedir and targetdir are located in such a way to make hard
  links possible).

I have run into some issues about what to do in certain cases:

  a) what should be the test for "sameness"?  It would be nice to rely
     on stat() information, like: mode, owner, group, size, mtime.
     What is a reasonably robust set of things to check?  I am
     planning to provide a --pedantic option that will also compare
     data before assuming "sameness", but for performance reasons I'd
     rather that not be the default mode.  Advice?

  b) what to do about symlinks?  I was thinking it would be useful to
     munge symlinks that originally point into the srcdir to point
     into the equivalent spot in targetdir instead, and leave others
     alone.  Advice?

Thanks for any insight!

[1] not really, because it can't efficiently catch files that have
    just moved, but nevermind about that.

-- 
Russell Senior         ``The two chiefs turned to each other.        
address@hidden      Bellison uncorked a flood of horrible       
                         profanity, which, translated meant, `This is
                         extremely unusual.' ''                      



reply via email to

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