inotifywait -m -r /path/to/monitor -e create -e moved_to -e modify -e delete |
while read dir action file; do
echo "The file '$file' appeared in directory '$dir' via '$action'"
// Do what you want here.
done
The following events are valid for use with the -e option: