Filesystem monitoring question
Giovanni P. Tirloni
gpt at tirloni.org
Thu Nov 17 16:30:20 GMT 2005
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
More information about the freebsd-hackers
mailing list