Questions tagged [inotify]

inotify is a Linux kernel subsystem that informs processes when files are accessed/created/modified or deleted.

The primary purpose of inotify is to prevent processes from regularly scanning file systems for changes which may be costly and have undesirable lags.

There is a command line interface and bindings exist for several languages including python, java, ruby, haskell, PHP.

To debug inotify related issues, you can log the actual events triggered by the inotifywatch tool. (part of the inotify-tools.)

633 questions
11
votes
1 answer

Sharing code directory from host with boot2docker does not call inotify on guest

I am trying to setup a dev environment with boot2docker/Virtualbox. Sharing a folder on the host with the docker container works, but since it is shared through a Virtualbox shared folder inotify does not trigger inside the container (and the code…
Andreas Arnold
  • 535
  • 5
  • 11
11
votes
5 answers

How could I detect when a directory is mounted with inotify?

I'm using Linux Inotify to detect FS events on my program. How could I be notified when a device is mounted on a monitored directory?
Ricardo
  • 1,778
  • 1
  • 19
  • 32
10
votes
1 answer

inotify event IN_MODIFY occurring twice for tftp put

I am using inotify to listen to modifications to a file. When I test file modification, program is working fine. # echo "test" > /tftpboot/.TEST Output: Read 16 data IN_MODIFY But when I do tftp put, two events are generated: tftp> put .TEST Sent…
m.divya.mohan
  • 2,261
  • 4
  • 24
  • 34
10
votes
1 answer

incrond running but not executing command under CentOS 6.4

I have installed incron from the EPEL repository (before you ask; YES, I also tried downloading the source and compiling locally; same results) and am attempting to set up a process on my CentOS 6.4 (final) virtual box that I have successfully…
JawzX
  • 293
  • 1
  • 2
  • 15
10
votes
3 answers

Haskell: Monitor a file without polling (à la inotify in linux)

Is there a haskell library function to monitor a file without polling? With polling i would do someting like this: monitor file mtime handler = do threadDelay n -- sleep `n` ns t <- getModificationTime file if t > mtime then…
scravy
  • 11,904
  • 14
  • 72
  • 127
10
votes
3 answers

Track folder changes / Dropbox changes

First of: I know of pyinotify. What I want is an upload service to my home server using Dropbox. I will have a Dropbox's shared folder on my home server. Everytime someone else, who is sharing that folder, puts anything into that folder, I want my…
cherrun
  • 2,102
  • 8
  • 34
  • 51
9
votes
2 answers

inotify - how to find out which user has modified file?

I'm looking for guidance on how to find out which user has modified a particular file. While inotify is great to get notification when a particular file is touched, how do I figure out which user has modified that file? I can think of using lsof but…
user837208
  • 2,487
  • 7
  • 37
  • 54
9
votes
2 answers

Monitoring file using inotify

I am using inotify to monitor a local file, for example "/root/temp" using inotify_add_watch(fd, "/root/temp", mask). When this file is deleted, the program will be blocked by read(fd, buf, bufSize) function. Even if I create a new "/root/temp"…
user572138
  • 463
  • 4
  • 6
  • 13
9
votes
1 answer

Reading File System Events from Linux Kernel without Inotify

In Linux to read File System Events, most of us use Inotify which is really a Good One. But it has it's limitations. I have to keep track of all the directories i have to watch and get a inotify descriptor for each and every directory. Let's say i…
Manikandaraj Srinivasan
  • 3,557
  • 5
  • 35
  • 62
9
votes
3 answers

Too many inotify events while editing in vim

I'm trying to use inotifywait for monitoring specific folders and recompiling if needed. The problem is that I'm using vim heavily, and when I'm editing in vim any file modified actually triggers some 'redundant' events, something…
shabunc
  • 23,119
  • 19
  • 77
  • 102
8
votes
5 answers

Retrieve the full path name from inotify_event

The inotify_event struct looks like this : struct inotify_event { int wd; /* Watch descriptor */ uint32_t mask; /* Mask of events */ uint32_t cookie; /* Unique cookie associating related events (for rename(2))…
bsd
  • 2,707
  • 1
  • 17
  • 24
8
votes
5 answers

inotify recursively how to do it?

i need to print events on a folder with multiple subfolders. how to do it recursivly? Please print a c++ code. I am stucked!! Every time the evet is poped i need to open the subfolder, take the file and copy it into another directory. I don't want…
user1165435
  • 231
  • 2
  • 4
  • 11
8
votes
3 answers

Automatically detecting file changes and synchronizing via S3

I have a local directory of media files on a Linux system, which I synchronise with an Amazon S3 account using an s3sync script. Currently, I'm manually running the s3sync script when I know the media files have been modified. How would I…
Cerin
  • 60,957
  • 96
  • 316
  • 522
8
votes
2 answers

How can one monitor what part of big file changed

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…
myroslav
  • 3,703
  • 23
  • 29
8
votes
2 answers

Premature IN_CLOSE_WRITE notification with pyinotify

I am experiencing the following situation: pyinotify monitors a file for IN_CLOSE_WRITE events I change something in the file and save it the event is triggered I read the file and see that it has no changes Having tinkered with this a little bit,…
ralien
  • 1,448
  • 11
  • 24
1 2
3
42 43