Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting File Create Notifications for CIFS Mount in Linux

I have a windows share mounted via CIFS on an ubuntu server. I need to a way to know when a new file has been added to the Windows share. I tried this inotify program:

http://www.thegeekstuff.com/2010/04/inotify-c-program-example/

Which works fine with standard directories, but is unable to catch any CIFS changes. I don't neccessarily need to use inotify, although I would like to, but any suggestions on how to accomplish getting file create notifications would be great.

like image 536
ofosho Avatar asked Nov 14 '11 16:11

ofosho


1 Answers

I have also been working on this and ran into the same issue - it seems (after a little trawling on google) that, unfortunately, it is not possible to use inotify on CIFS mounted partitions - The following was in a redhat forum post from a couple of years ago:

"Currently, no this isn't possible with CIFS. The VFS hooks to allow a filesystem to set up extra notfications were removed recently. The only "user" of them was CIFS and it never worked properly anyway. The kernel interface for this had serious problems too.

I think Steve has plans to reimplement it, but it's a major project that means adding new functionality to the VFS layer of the kernel."

While this was a couple of years ago, it seems we are no closer to having this facility available - shame, I could have really used it too!

like image 107
Stephen Sullivan Avatar answered Oct 08 '22 01:10

Stephen Sullivan