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

580 questions
15
votes
4 answers

Too many open files - Failed to initialize inotify: the user limit on the total number of inotify instances has been reached

How can I fix below problem? I am using compass. Too many open files - Failed to initialize inotify: the user limit on the total number of inotify instances has been reached. …
verlager
  • 1,262
  • 5
  • 20
  • 38
14
votes
5 answers

Is there a build tool based on inotify-like mechanism

In relatively big projects which are using plain old make, even building the project when nothing has changed takes a few tens of seconds. Especially with many executions of make -C, which have the new process overhead. The obvious solution to this…
Elazar Leibovich
  • 30,136
  • 27
  • 116
  • 161
14
votes
2 answers

How to check in python that a file in a folder has changed?

I need to know in python whenever a new file was added/removed/modified in a particular directory Is there a way for that? I'm looking for an "inofity"-like function (from POSIX). Thanks
Novellizator
  • 9,169
  • 9
  • 38
  • 58
13
votes
2 answers

Permanent fix to tail: cannot watch `log/development.log': No space left on device

I've been using Ubuntu 11.10 for a little over a week now. But after some time I encountered this error(the one in the title) when Im trying to access the log in my RoR project. I found a fix which is by pasting this in the terminal: sudo sysctl…
Normz
  • 271
  • 1
  • 2
  • 9
13
votes
2 answers

inotifywait in docker-container doesn't register changes

I have a script running inside a docker-container which listens for changes in a directory via inotifywait. The directory is mounted to the host-system via docker -v. For some reason, inotifywait doesn't get triggered when files inside this…
Johannes Reuter
  • 2,937
  • 13
  • 17
11
votes
6 answers

inotifywait - exclude regex pattern formatting

I am trying to use inotifywait to watch all .js files under my ~/js directory; how do I format my regex inside the following command? $ inotifywait -m -r --exclude [REGEX HERE] ~/js The regex - according to the man page, should be of POSIX extended…
gsklee
  • 4,264
  • 4
  • 36
  • 55
11
votes
5 answers

Missing inotify events (in .git directory)

I'm watching files for changes using inotify events (as it happens, from Python, calling into libc). For some files during a git clone, I see something odd: I see an IN_CREATE event, and I see via ls that the file has content, however, I never see…
Michal Charemza
  • 23,220
  • 10
  • 87
  • 124
11
votes
2 answers

mod_wsgi: Reload Code via Inotify - not every N seconds

Up to now I followed this advice to reload the code: https://code.google.com/archive/p/modwsgi/wikis/ReloadingSourceCode.wiki This has the drawback, that the code changes get detected only every N second. I could use N=0.1, but this results in…
guettli
  • 26,461
  • 53
  • 224
  • 476
11
votes
3 answers

Cannot install inotify on Amazon EC2

I have an AWS EC2 instance and wants to install inotify-tools. I've added the repository by executing the command: rpm -Uvh http://download.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm then execute yum install inotify-tools but…
marvinv
  • 161
  • 2
  • 9
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
  • 519
  • 5
  • 11
11
votes
4 answers

inotify file in C

I am trying to run an example of inotify in C..but it's not working. I want to monitor modifications to a file (the file is tmp.cfg), but it doesn't work..I don't know if i'm running it correctly, because I understand how to monitor directories, but…
mar_sanbas
  • 663
  • 2
  • 11
  • 19
10
votes
3 answers

Error: ENOSPC: System limit for number of file watchers reached angular

I am getting this error while doing my Angular 10 project. Error from chokidar (/myProject): Error: ENOSPC: System limit for number of file watchers reached, watch '/myProject/tsconfig.spec.json' Is there a method to resolve this error?
MikhilMC
  • 353
  • 2
  • 4
  • 10
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
  • 10,869
  • 11
  • 60
  • 115
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
  • 1,862
  • 8
  • 30
  • 50
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,309
  • 6
  • 34
  • 50
1
2
3
38 39