Questions tagged [inotify]

inotify is a Linux kernel subsystem that works to expand filesystems to notice changes to the filesystem, and report those changes to applications.

The inotify API provides a mechanism for monitoring file system events. Inotify can be used to monitor individual files, or to monitor directories. When a directory is monitored, inotify will return events for the directory itself, and for files inside the directory.1

1Source:Linux man page 7

46 questions
67
votes
3 answers

User limit of inotify watches reached on Ubuntu 16.04

I just installed Ubuntu 16.04 and I get this warning when I start SmartGit: IOException: User limit of inotify watches reached Moreover I get this warning launching tail -f: tail: inotify resources exhausted tail: inotify cannot be used,…
Andrea
  • 1,077
60
votes
2 answers

How can I tell if I am out of inotify watches?

I use an application that consumes inotify watches. I've already set fs.inotify.max_user_watches=32768 in /etc/sysctl.conf but last night the application stopped indexing unless I ran it manually, which leads me to suspect I am out of watches.…
Jorge Castro
  • 73,717
39
votes
4 answers

How do I fix a "Can't access Dropbox folder" error?

I'm having a rather strange problem with Dropbox that started a few weeks ago. Dropbox will stop syncing with the message "Can't access Dropbox folder", and refuse to sync until I reboot. I've tried restarting Dropbox and logging out, but nothing I…
user1614
13
votes
4 answers

Why do inotify events fire more than once

This question arises from another one that I had posed on Stackoverflow. I am using Watcher - the same issues apply to Incron - to monitor a folder and its child folders for changes and silently squirrel away those changes to Dropbox. I monitor the…
DroidOS
  • 507
13
votes
3 answers

How to run a script when a directory is changed by another user?

I know has been a bit of discussion about topics similar to this. But here is what I am basically trying to do. I have a watch directory called watched and whenever a file is added to that directory, I want to trigger a script called syncbh.sh which…
12
votes
1 answer

Why I got Failed to allocate directory watch: Too many open files?

I tried update on 22.04 Failed to allocate directory watch: Too many open files Hit:1 https://download.docker.com/linux/ubuntu jammy InRelease Hit:2 https://apt.releases.hashicorp.com jammy InRelease …
8
votes
2 answers

How do I run a python script whenever a file is created in a directory?

So, I'm trying to do this, somewhat, simple task, but I have not been successful yet. I'm hoping that changes now. The goal: Run /var/www/lager-scanner/filer/pluk_script.py whenever there is a new file in /var/www/lager-scanner/filer/Nav/FromNav,…
Folkmann
  • 193
8
votes
2 answers

inotify/max_user_watches value resets on reboot; how to change it permanently?

Some software that I'm using needs a higher-than-default value in /proc/sys/fs/inotify/max_user_watches. I can modify this value with a text editor or from the terminal, and for a little while, everything is fine. However, after restarting my…
8
votes
2 answers

Evince is no longer auto-reloading documents. How can I troubleshoot this?

Evince (the pdf viewer) used to reload my .pdf files after I compiled them in LaTeX. However, this behavior has recently stopped to the point where I have to manually reload Evince (control + R) to show changes. I have tried resetting the desktop…
evencoil
  • 787
6
votes
4 answers

Stop inotifywait instance

I made a script to invoke inotifywait. It works fine, but I sometimes want to stop it. How do I stop the last inotifywait instance? I cannot understand how to use inotify_rm_watch which I understand is used to close it. 7341 ? S 0:00…
fixit7
  • 3,399
6
votes
2 answers

Monitor folder and run command if there is a file there?

I would like to have my Ubuntu monitor Folder A. If there is a .sh file there, i would like to move that file to Folder B and run it in the background. Is this possible? What should I use to make it happen?
Ignacio
  • 817
6
votes
2 answers

How do I get the filename from inotifywait events?

So I'm doing a simple inotifywait loop to watch for changes in a Bootstrap directory: while inotifywait -r -q --format %w bootstrap/; do echo "something happened" [[ $filename == *.js ]] && uglifyjs ..... [[ $filename == *.less ]] &&…
Oli
  • 299,380
4
votes
1 answer

How does one install the PECL inotify extension for PHP7?

I'm trying to get Inotify working on PHP7. I've installed the required packages: sudo apt install php php-dev And installed Inotify with Pecl: sudo pecl install inotify But it doesn't work: $ php -r…
3
votes
1 answer

inotify in a remote shell and get the output back

My problem is very similar this one: inotify not fast enough Except I am running inotify in a remote shell. I need to monitor for file change on machineA from machineB. machineB has ssh access to machineA but not the other way around. while true;…
zengr
  • 818
3
votes
1 answer

Increase inotify watchers without using root priviledges

Is there a way to increase the amount of inotify watchers without having admin privileges? In worst case, with apt-get? I am not admin, but have sudo apt-get install permissions.
Serge
  • 173
1
2 3 4