如何监控大文件的哪一部分发生了变化
Linux kernel-3.0(或更高版本)是否有解决方案,允许人们获得类似于 inotify
的通知,描述已更改的特定文件段?
有 fschange
补丁,最高可达 kernel-2.6.21。有可用的最新解决方案吗?最近的fanotify
能够提供该功能吗?
Is there solution for Linux kernel-3.0 (or later) that allows one to get notifications similar to inotify
describing particular segment of file that was changed?
There was fschange
patch for up to kernel-2.6.21. Is there any up to date solution available? Is recent fanotify
able to provide the functionality?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
据我所知,但有一种方法可以通过使用文件更改通知作为指示器来读取文件系统的磁盘格式并检查内部文件系统块分配表以了解更改的内容来破解功能。
这样做很棘手,会受到竞争条件的影响,而且可能是一个坏主意,但如果您必须这样做,并且在 3.0 之上编写 fschange 不适合您,那么这可能是一个不错的选择。
Not that I know of, but there is a way to sort of hack the functionality by using the file change notification as an indicator to read the on disk format of the file system an examine the internal file system block allocation tables to learn whats changed.
It's tricky to do, suffers from race conditions and probably a bad idea, but if you must and coding an fschange on top of 3.0 is not an option for you, it might be the way to go.
IMO...忘记使用inotify,除非“漂亮”很重要。除此之外,您可以使用执行 diff 的脚本或使用带有 MTIME 选项的 FIND 来设置 cronjob。
IMO... forget using inotify unless "the pretty" is important. Other than that, you can setup a cronjob with a script doing a diff or using FIND with the MTIME option.