-
-
Notifications
You must be signed in to change notification settings - Fork 406
Description
Hi
I really don't know how to manage with it ( inotifywait )
This is my current shell script
inotifywait -m -r -e create -e moved_to --include "^.*(txt|docx)$" --format '%w%f' "${MONITORDIR1}" | while read NEWFILE
do
echo "FILE DETECTED: " + $NEWFILE
mv "$NEWFILE" "$DESTINATIONRENAMED"
sleep 1
done
The issue I have it's when I create a folder 'toto' and a file 'titi.txt' into 'toto'.
To remember this 'toto' folder is created into "${MONITORDIR1}
I started the shell script (inotifywait) , added the folder 'toto' with the file 'titi.txt' into the watched path "${MONITORDIR1}"
The consequence: Nothing is watch / catch
I need to modify the name of the folder or the file which are into this current folder watched by inotify and then inotify see them
I don't know if I use something wrong with the tool ? I need to watch when titi.txt is here and do something after that
Thanks
NB: If I remove the include attribute, inotify see directly the new folder 'toto' ( but not the file inside it 'titi.txt' )