Workaround for inotify on NFS-clients

I run multiple virtual machines which shares all their data via a NFS-server. I have an application that fetches files, and another server that watches for new files in a folder, using inotify. But i quickly noticed that inotify does not work over NFS. I “fixed” this by doing a simle workaround that finds all files in the watched folder, and simply touches them. This causes inotify to dectect those files.

Example:
find s -type f -exec touch {} \;

This works for me since i can simply run the command via cron, or via another scheduled job, but that does not mean that i works for your case. But perhaps it gives you some ideas.

One thought on “Workaround for inotify on NFS-clients

  1. hello, thats sounds great. would you please describe your work in detail? ive an pvr with .ts videofiles, that were mounted via nfs. inotify should realize when a new .ts is written and start then an encoding script. thank you.

Leave a Reply