NetBSD-Users archive

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

Re: filesystem change monitoring



On Wed, Aug 12, 2015 at 04:23:39AM +0000, Christian Koch wrote:
|On Tue, Aug 11, 2015 at 02:44:10PM +0000, Emmanuel Dreyfus wrote:
|> Do we have a smart way to monitor a whole filesystem hierarchy for
|> changes? kqueue seems a good answer at a glance, but as far as I
|> understand, I need to setup a filter for every single file and
|> directory in the hierachy, and this can quickly hit kern.maxfiles.
:
|> Any idea how this can be done efficiently?
|
|Hmm, you might be out of luck. It seems that even people who have put a
|lot of time (and code) into this question haven't come up with anything
|much better. Take a look at the README of this GitHub repo I found:

it's not a direct answer, however in Linux they appear to have a
framework to expose these sort of events from the kernel to subscribers
of the information.

I have used this in the past to implement a poor-man's cluster solution
using lsyncd and rsyncd - essentially lsyncd hooks into the filesystem
event notification system and then does near realtime sync of those
changes to a remote host using the rsync protocol ... uni-directional to
a single slave iirc, but might give people interested in getting this
running a model to follow ...

https://code.google.com/p/lsyncd/

Hope that helps,
Malcolm

-- 
Malcolm Herbert
mjch%mjch.net@localhost


Home | Main Index | Thread Index | Old Index