[CentOS] Watching a directory

Thu Mar 17 01:50:03 UTC 2011
Trutwin, Joshua <JTRUTWIN at CSBSJU.EDU>

> Let start with adding files. What tools are available for me to watch a directory. 
> In an example, if a file is added to a directory I want to run a shell script that 
> will do some conversation on the file to produce a second copy.

I just was working on something like this today - yum search inotify - here's a nice intro with an example close to what I'm using:

https://github.com/rvoicilas/inotify-tools/wiki/#info (inotifywait example 1)

I used -e create -e modify -e delete instead of -e close_wait - see the man page for events.

Very slick so far.

Josh