AME AME - 1 year ago 106
Python Question

How to watch a nfs-mounted directory for newly created or changed files under Linux with Python?

There is a directory on a server I have now access to except for nfs-mounts. I mount the directory via nfs into a local linux system. New files arrive in the directory and some older files may get updated via other processes on the server.

I'd like to write a Python script that kicks into action whenever such a file is created or changed. I know that it is possible to watch a local directory with Linux and Python using inotify (or dnotify in older Versions). However these do not seem to work for remotely mounted volumes.

What are my options or is there a solution already implemented?

Answer Source

You could try FAM.

FAM can provide an RPC service for monitoring remote files (like a mounted NFS file system).

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download