On Wed, 02 Feb 2005 17:00:22 +0300, Deomid Ryabkov <[EMAIL PROTECTED]> wrote:
> Milan Obuch wrote:
> 
> >>>>>>This could be a custom filesystem wrapper for UFS that would report
> >>>>>>name of the file/directory being changed.
> >>>>>>
> >>>>>>
> >>>>>Couldn't you use kqueue system to monitor the directory-file?
> >>>>>
> >>>>>
> >>>>I could, if I hadn't near 10 millions of them.
> >>>>
> >>>>
> >>>Hm. I meant monitoring the directory itself, as a file, then parsing
> >>>the directory list to determine what has changed. But with 10M files,
> >>>probably nothing would work...
> >>>
> >>>
> >>these are 10M of static documents, the daily change is minmal.
> >>the question is: where it is the appropriate place to collect those
> >>changes? the right way seems to implement a customs filesystem, but would
> >>it possible to obtain a full path at that level?
> >>
> >Did you consider using fam (file alteration monitor) from ports?
> >
> >
> 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)
> 
> --
> Deomid Ryabkov aka Rojer
> [EMAIL PROTECTED]
> [EMAIL PROTECTED]
> ICQ: 8025844
> 

   I once wrote a very small tool that used the kqueue API for
tracking descriptor changes. It basically read a list of files, open
them in read-only mode, and sent messages to syslog everytime one of
the descriptors changed status. In fact, if you read the kqueue
documentation (http://people.freebsd.org/~jlemon/papers/kqueue.pdf),
you'll pretty much find all you need.

> 
> 


-- 
If it's there, and you can see it, it's real.
If it's not there, and you can see it, it's virtual.
If it's there, and you can't see it, it's transparent.
If it's not there, and you can't see it, you erased it.
_______________________________________________
freebsd-hackers@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-hackers
To unsubscribe, send any mail to "[EMAIL PROTECTED]"

Reply via email to