Getting File Create Notifications for CIFS Mount in Linux

后端 未结 5 2300
粉色の甜心
粉色の甜心 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:22

    I too ran into this and reached the same conclusion as Stephen Sullivan (CIFS + inotify = no go).

    However, since my workflow happened to depend on both remote mounts and auto-compile tools that rely on inotify, I ended up building a (fairly desperate & hacky) solution which basically just uses polling to watch for changes and then touches the same files again on the mounted side, which does seem to fire off inotify events. It is not my proudest moment.

    Having said that, it does work, so, enjoy: http://github.com/rubyruy/watchntouch

提交回复
热议问题