简体   繁体   中英

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.

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)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM