Question: tracking filesystem changes?

A G Keahan alex at hightemplar.com
Sun Feb 6 21:55:06 PST 2005


 > > No, won't do the trick either.  I cannot afford setting up watchdogs
 > > for every file or even every directory.  And I'm essentially
 > > "interested" in every one of them (for mirroring purposes).  A more
 > > general approach is needed.  E.g., if an unlink call is issued and
 > > an inode is within a particular filesystem (luckily, most of our
 > > data already lives on or can be easily moved to a separate
 > > filesystem), a notice is sent to some userland daemon:
 > > "file /www/xxx/yyy.shtml is unlinked". Or opened for writing, or
 > > renamed... etc.  The file is then scheduled for distribution to
 > > mirrors.  The idea seems simple and straightforward, yet I don't
 > > know if it is achievable.
 > >
 > > The essential part is obtaining the full pathname of the file (won't
 > > bother with hardlinks at first, they aren't used here).  Could that
 > > be done with the FreeBSD's filesystem (vnode/vfs?) code? (which I'm
 > > not familiar with)

Nick,

You might want to take a look at Matt Dillon's journalling work
in DragonFly BSD.   Their journalling layer can send a filesystem
operations change stream (essentially, vfsops such as create, write,
truncate, rmdir, etc) to any file descriptor, which makes filesystem
changes easy to track and replicate to other machines.

See the "Description of the Journaling topology" thread at

http://leaf.dragonflybsd.org/mailarchive/kernel/2004-12/dateindex.html

Alex


More information about the freebsd-hackers mailing list