Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 30 Dec 2015 23:24:00 -0800
From:      Chris Stankevitz <chris@stankevitz.com>
To:        FreeBSD Filesystems <freebsd-fs@freebsd.org>
Subject:   Monitoring FS changes
Message-ID:  <5684D810.6070700@stankevitz.com>

next in thread | raw e-mail | index | archive | help
Hi,

I have a directory /foo that recursively contain ~250,000 files/directories.

I would like my application to know when a file is added, removed, or 
modified under /foo.  Is there a way to do that with FreeBSD?

I believe on linux a facility called iNotify accomplishes this.

On OSX a facility called FSEvents accomplishes this.

kqueue apparently requires me to open every file and/or directory in my 
tree... which won't work because I have so many.

Is there any other option?  Perhaps

i=0
while (true)
{
  zfs snapshot pool/foo@${i}
  zfs diff pool/foo@${i-1} pool/foo@${i}
  ++i
}

Thank you,

Chris



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5684D810.6070700>