in reply to Watching a driectory for change

Rolling your own is a nice exercise and all, but if you're on a production machine it's best to leave it to the pro's. Check out tripwire.org, which is an open-source project dedicated to this very task (with a versionable file system for backing up a file when it does become modified, etc). At the very least, it will give you good ideas on the various cases you will encounter. Good luck.