Possible Duplicate:
Can a bash script be hooked to a file?
On Mac OS X, there’s a handy daemon called launchd which (amongst other things) allows you to have scripts run when files or directories change (via the WatchPaths
and QueueDirectories
plist file options).
Is there a (preferably Debian) Linux program/package that includes this functionality?