How can a program monitor a whole directory tree for changes in Linux (ext3 file system)?
Currently the directory contains about half a million files in about 3,000 subdirectories, organized in three directory levels.
Those are mostly small files (< 1kb, some few up to 100 kb). It's a sort of queue and I need to know when files are being created, deleted or their content modified within 5-10 seconds of that happening.
I know about inotify and other similar APIs, but AFAIK they only monitor a single directory, which means I would need 3,000 inotify handles in my case - more than the usual 1024 handles allowed for a single process. Or am I wrong?
In case there isn't a Linux API that can tell me what I need: perhaps there is a FUSE project that simulates a file system (replicating all file accesses on a real file system) and separately logs all modifications (couldn't fine one)?