Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 17 Nov 2005 14:29:56 -0200
From:      "Giovanni P. Tirloni" <gpt@tirloni.org>
To:        Cornelis Swanepoel <rools.ster@gmail.com>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Filesystem monitoring question
Message-ID:  <437CB004.2000401@tirloni.org>
In-Reply-To: <a9f55af40511170707n3dd70429t48d85acf9b3be5f4@mail.gmail.com>
References:  <a9f55af40511170707n3dd70429t48d85acf9b3be5f4@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Cornelis Swanepoel wrote:
> I have a FreeBSD 6.0 box with a partition that is accessible to a number of
> clients via SMB and NFS.
> 
> I would like to monitor activity on this partition so that every time a
> write to it is completed, my C program is run (which stats the file and
> stores some info about it in a database amongst other things)
> 
> My question is: What do I need to learn in order to construct a trigger for
> my code?
> 
> If anyone can point me in the right direction I would greatly appreciate it.

  Using kqueue you can monitor a file/directory for changes and have it 
trigger something when that event happens. But you want to monitor you 
whole partition.. perhaps intercept some syscalls ?

-- 
Giovanni P. Tirloni
http://blog.tirloni.org




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?437CB004.2000401>