Date: Sun, 03 Jan 2016 15:08:37 -0600 From: Mark Felder <feld@FreeBSD.org> To: Chris Stankevitz <chris@stankevitz.com>, FreeBSD Filesystems <freebsd-fs@freebsd.org> Subject: Re: Monitoring FS changes Message-ID: <1451855317.3739776.481776018.64F6C4D9@webmail.messagingengine.com> In-Reply-To: <5684D810.6070700@stankevitz.com> References: <5684D810.6070700@stankevitz.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, Dec 31, 2015, at 01:24, Chris Stankevitz wrote: > 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 > } > Yes, Linux has inotify (just be aware it doesn't actually work on inodes like it indicates: changes to alternative hard links are ignored if they're not in the file path you're monitoring), OSX has fsevents, Solaris derivatives have File Events Notification, and we're stuck with kqueue which doesn't scale. I'm not aware of anything else being available for us. If someone, anyone out there is capable of bringing us something that does scale it would be greatly appreciated. Lots of nice Linux software uses this, but when they do port to FreeBSD we have to do full filesystem scans. It's such a waste. -- Mark Felder ports-secteam member feld@FreeBSD.org
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1451855317.3739776.481776018.64F6C4D9>