1 |
Am 05.05.2010 15:34, schrieb Stroller: |
2 |
> |
3 |
> On 5 May 2010, at 07:54, Iain Buchanan wrote: |
4 |
>> ... |
5 |
>> I'm looking for some kernel-based notification of changes to my file |
6 |
>> system. I've been looking at inotify, but it's not exactly what I want. |
7 |
>> |
8 |
>> Basically I want to know if _any_ write occurs anywhere. I don't want |
9 |
>> to register a whole bunch of files to watch, I just want to watch an |
10 |
>> entire mount. |
11 |
> |
12 |
> man inotify(7): |
13 |
> ... When a directory is monitored, inotify will return events for the |
14 |
> directory itself, and for files inside the directory. |
15 |
> |
16 |
> |
17 |
> Am I missing something? |
18 |
> |
19 |
> |
20 |
> This article was posted to a different froup recently: |
21 |
> http://www.ibm.com/developerworks/linux/library/l-inotify/index.html |
22 |
> It looks interesting. |
23 |
> |
24 |
> |
25 |
> Stroller. |
26 |
> |
27 |
|
28 |
To repeat my comment on Iain's original "backup to a cold-swap drive" |
29 |
thread, Inotify has two drawbacks which make it hard or even impossible |
30 |
to use for Iain's use case: |
31 |
|
32 |
a) It does not work recursively which means that you have to create a |
33 |
new handle for each subdirectory. Of course, this only means more work |
34 |
for the programmer but there is also the problem that |
35 |
|
36 |
b) As far as I know, Inotify does not scale very good, at least not good |
37 |
enough to monitor a whole system. /proc/sys/fs/inotify/max_user_watches |
38 |
is 65535 on my system. |
39 |
|
40 |
On the other hand, I've never tried to increase that limit and just let |
41 |
it run on a deep directory structure. Who knows, maybe it actually works. |
42 |
|
43 |
Hope this helps, |
44 |
Florian Philipp |