inotifywait support for xattrs #23
ross-spencer
started this conversation in
Show and tell
Replies: 1 comment 1 reply
-
|
This sounds amazing! I was hoping for inotify to be of use for this, but I haven't found the time to really test it. Which filesystem did you test it on? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Thinking about how to continually monitor changes to xattrs I wanted to test
inotifywaitfrominotify-tools: https://github.com/inotify-tools/inotify-tools (101: https://oneuptime.com/blog/post/2026-01-15-use-inotifywait-file-monitoring-ubuntu/view)A small demo:
Create two terminal tabs or windows.
Window 1:
Window 2:
Window 1:
Window 2 (output):
Setting up watches. Beware: since -r was given, this may take a while! Watches established. 2026-04-24T09:52:07 CREATE /tmp/xattrs/testfile1 2026-04-24T09:52:07 OPEN /tmp/xattrs/testfile1 2026-04-24T09:52:07 ATTRIB /tmp/xattrs/testfile1 2026-04-24T09:52:07 CLOSE_WRITE:CLOSE /tmp/xattrs/testfile1 2026-04-24T09:52:23 ATTRIB /tmp/xattrs/testfile1 2026-04-24T09:52:37 ATTRIB /tmp/xattrs/testfile1 2026-04-24T09:52:46 CREATE:ISDIR /tmp/xattrs/subdir 2026-04-24T09:52:46 OPEN:ISDIR /tmp/xattrs/subdir 2026-04-24T09:52:46 ACCESS:ISDIR /tmp/xattrs/subdir 2026-04-24T09:52:46 CLOSE_NOWRITE:CLOSE:ISDIR /tmp/xattrs/subdir 2026-04-24T09:52:51 CREATE /tmp/xattrs/subdir/testfile2 2026-04-24T09:52:51 OPEN /tmp/xattrs/subdir/testfile2 2026-04-24T09:52:51 ATTRIB /tmp/xattrs/subdir/testfile2 2026-04-24T09:52:51 CLOSE_WRITE:CLOSE /tmp/xattrs/subdir/testfile2 2026-04-24T09:53:04 ATTRIB /tmp/xattrs/subdir/testfile2 2026-04-24T09:53:23 ATTRIB /tmp/xattrs/testfile1Result
Inotifywait has monitored the creation of new files and successfully monitored the addition/modification and deletion of extended attributes.
We can follow a log like this (or create similar tooling) to monitor a directory or set of directories setup to store large numbers of extended attribute based files for systems such as the AHAlodeck fs database.
Inotifywait can run as a daemon and the event logs sent elsewhere to be monitored or used to then trigger other events around the attributes such as indexing.
Beta Was this translation helpful? Give feedback.
All reactions