在Linux中获取CIFS挂载的文件创建通知 [英] Getting File Create Notifications for CIFS Mount in Linux

查看:289
本文介绍了在Linux中获取CIFS挂载的文件创建通知的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在ubuntu服务器上通过CIFS安装了Windows共享.我需要一种方法来知道何时将新文件添加到Windows共享中.我尝试了这个inotify程序:

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/

在标准目录下可以正常工作,但是无法捕获任何CIFS更改.尽管我愿意,但我不一定需要使用inotify,但是有关如何完成获取文件创建通知的任何建议都是很好的.

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.

推荐答案

我也一直在研究此问题,并遇到了相同的问题-不幸的是,似乎(在Google上稍作拖延之后)在CIFS挂载的分区上使用inotify-以下是几年前在redhat论坛上的帖子:

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:

"当前,CIFS无法做到这一点.VFS钩子允许 最近删除了用于设置额外通知的文件系统.这 他们中只有用户"是CIFS,但它始终无法正常工作.这 内核接口也有严重的问题.

"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.

我认为史蒂夫有计划重新实现它,但这是一个重要的项目 这意味着要向内核的VFS层添加新功能."

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!

这篇关于在Linux中获取CIFS挂载的文件创建通知的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆