I know at least three ways to monitor a folder/file for changes and execute a shell script on change.
First, use "Folder Actions" of Automator
Second, the launchd.plist approach but it seems the folder been monitored couldn't go through recursively.
Third, use native FSEvents API on Mac OS X. like the modified fswatch utility
My question is that which one cost system resource (CPU or memory) less ?