Getting File Create Notifications for CIFS Mount in Linux

后端 未结 5 2278
粉色の甜心
粉色の甜心 2021-01-04 02:01

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:

5条回答
  •  半阙折子戏
    2021-01-04 02:27

    Old topic, still important! My answer to this is: "it depends!". From my empirical tests at this time, the behavior is quite clear. If the Linux host initiates the filesystem event [upon a CIFS mount], then inotify will see it just fine. If the Windows machine which hosts the CIFS mount initiates the filesystem event, then inotify [on the Linux machine] will not see it at all.

    If your goal is for the Linux host to get notification that the Windows host created or wrote to a file, then you are out of luck. Since this is probably the most desired use of this mechanism, it does make this subtle "it depends" answer not so terribly useful!

提交回复
热议问题