1
I need to detect file changes with inotify-tools. Here is the algorithm:
File changed -> .sh script executed in the same folder, where the file changed.
How can I achieve that?
#!/bin/sh
MONITORDIR="/path/to/the/dir/to/monitor/"
inotifywait -m -r -e create --format '%w%f' "${MONITORDIR}" | while read NEWFILE
do
sh ./***/execscript.sh
done
I think, that I need to change something after while read NEWFILE
and of course, replace **** with a path to that directory.