0

I have a FreeBSD installation and a very large directory structure with 10TiB of small files.

I want to programmatically monitor and handle events such as a new file created or existing modified. I have tried to use kqueue() but it requires to open every directory and file. Traversing through the whole directory structure is taking too long and can never be finished in adequate time. (I even left it for a night and had no success.)

Is there another way to do the same on FreeBSD but in an efficient way?

By the way, does Linux handle such amount of data using inotify?

Thanks for any suggestions!

Dení
  • 183
  • 1
  • 9
  • Could this [question/answers](http://apple.stackexchange.com/questions/40705/monitor-a-folder-for-changes-and-run-a-command-when-a-change-is-detected) be a solution for your situation? Launchd is ported to FreeBSD. – d-b Feb 03 '15 at 08:29
  • got any feasible solution for watching big directory? – amarjeetAnand Sep 18 '18 at 15:35
  • @amarjeetAnand Unfortunately, no. We opted for a simple spool design and scheduled monitoring. – Dení Feb 02 '19 at 13:14

1 Answers1

0

Please have a look at /usr/ports/devel/fam, the File Alteration Monitor, which provides an API which applications can use to be notified when specific files or directories are changed.

opsec
  • 1
  • 1