sadmicrowave
sadmicrowave

Reputation: 40892

python pyinotify event from externally created file

I have a pyinotify instance watching a mounted network drive (mounted with CIFS) for IN_WRITE_CLOSE events which picks up the system created events (sudo cp, sudo mv, etc.) flawlessly if the server itself puts files in this directory.

However, I would like to pick up the events for files that are created on this network drive by a different server and program.

For some reason my inotify instance is not seeing these events...Is this normal behavior or could there be something wrong with my code? If this IS normal behavior, is there a way around it or do I have to find a different monitoring tool other than inotify to gather these events?

UPDATE

per @Cedric's answer I changed my mountpoint to NFS but I am still not getting any events.

Upvotes: 1

Views: 1328

Answers (1)

Cédric Julien
Cédric Julien

Reputation: 80751

According to this thread on the linux cifs client, this wasn't implemented (nor really scheduled) in 2009.

For the NFS part, well, it works on NFS mount, but only if the listener is the same machine than the creater/modifer/deleter of the file.... :( (source here)

Last, I ended by founding a hook (just here), this is a python script that you have to run on the remote server that will send to you the events (the script is made to talk to a MediaTomb server on http, but you can implement your own sender)

Upvotes: 1

Related Questions