title: How to monitor a complete directory tree for changes in Linux?
body: <p>How can I monitor <em>a whole directory tree</em> for changes in Linux (<em>ext3</em> file system)?</p>
  
  <p>Currently the directory contains about <em>half a million files</em> in about <strong>3,000 subdirectories</strong>, organized in three directory levels.</p>
  
  <p>Those are mostly small files (&lt; 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.</p>
  
  <p>I know there is <em>inotify</em> and sorts, 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?</p>
  
  <p><em>In case the Linux system can't tell me what I need: perhaps there is a <a href="http://fuse.sourceforge.net/">FUSE</a> project that simulates a file system (replicating all file accesses on a real file system) and separately logs all modifications (couldn't fine one)?</em></p>