Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to figure out a way to notice when a certain file is written to on the network folder mounted. I am aware that one can continuously probe the location to see if it has been created but that's very nice. I am also aware that one can use inotify, and derivatives of it like iwatch and inotify-tools, to look for kernel flags. However, it is a network folder the flags are not raised on the machine where the folder is mounted to.

So I was wondering if there are other ways to do this. I was thinking maybe use messaging queues like RabbutMQ. Check when the files are written and send message to a queue then read the message on mounted machine and do whatever?

share|improve this question

If you don't think the inotify suite of tools are appropriate here, and you're using Linux, try Monit and an existence or filesystem test against the remote share.

 check file with path /nfs/appdata.txt
   if does exist then alert 

Maybe a cleaner example here. Is the filename known or not?

share|improve this answer
I just read the intro to Monit ( and it wants a poll interval. So am I right in thinking it will just probe every X seconds? – Alex Oct 22 '13 at 14:07
Default is 60 seconds... but you can tune that appropriately. – ewwhite Oct 22 '13 at 14:20
Yeah that still does continuous probing I wanted something I little more clever and asynchronous. – Alex Oct 22 '13 at 15:57

There is no way for a client to get notified when the mounted directory changed on the server (well, nfs v4.1 spec has a way to do it, but there are no implementations doing this). You have to poll.

If you can run a special applications on the server, then you can use something like lsync and have a custom handler to notify client with a mechanism of your choice.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.