I was thinking this was going to be rather easy, but it's turn out not to be.
I have a mounted network server that has inotifywatch
running on it watching a folder. I was wanting to have this set up so that anyone on the network with access to this server could drop a file into the watched folder and have it execute a script. Unfortunately it doesn't seem to trigger unless the file was moved on the server itself.
Is there any way to make inotify
watch a folder in a way that if any file, from anywhere, triggers the inotify event? Or should I look into something else?
For reference, here is what I'm using in a shell script:
inotifywait -m --format '%f' -e moved_to "/mnt/server/folder/" |
while read NAME
do
echo $NAME
done
inotifywait -m --format '%e' "/mnt/server/folder/
and moved a file from my machine to the servers watch directory, and no event triggered. I then moved a file from within the server to the watch directory and got amoved_to
event as I would expect. It might be worth noting that I was SSHed in to move the file when the event fired. When I move a file from my machine within the server (i.e. drag and drop in Finder) no event fires. – Hatchet