Questions tagged [inotify]

36 questions
29
votes
3 answers

Continuously detect new file(s) with inotify-tools within multiple directories recursively

I just installed inotify-tools. I would like to continuously detect new file(s) with notify-tools within multiple directories recursively, and send an email using postfix. I can probably handle the send an email using postfix part. I'm just trying…
22
votes
1 answer

How to know which file or inode triggered a systemd.path unit?

Systemd offers unit files whom control monitoring of a certain path trough inotify: systemd.path(5). If a file or directory is modified in the watched path the corresponding systemd.service(5) is called. According to the inotify(7) man page: To…
Tim
  • 1,343
15
votes
1 answer

How to get current number of opened inotify watches?

My system is CentOS. I'm trying to get this by listing fs.inotify variables via sysctl call (sysctl fs.inotify), but didn't found anything useful, only variables to specify limits.
Olegas
  • 251
12
votes
4 answers

Watch Filesystem in Real Time on OS X and Ubuntu

I'm looking for a CLI tool which will watch a directory and spit out the names of files that change in real time. some_watch_command /path/to/some/folder | xargs some_callback I'm aware of inotify (inotify-tools?) and it seems to be what I need,…
6
votes
1 answer

Dropbox: Unable to monitor dropbox folder

I'm using Dropbox on an Arch Linux System. Everything worked fine for months now, until today. When running Dropbox from command line, it prints the error message: Unable to monitor entire Dropbox folder hierarchy. Please run "echo…
LukeLR
  • 1,561
5
votes
1 answer

How do I configure fsnotify's queue size/watch limit on OSX?

Note: This might be a StackOverflow question, since it's about something that's only accessible via the internal API on OSX, but I'm posting it here since it seems to be more about using a tool that's already available than about programming for…
Zac B
  • 2,903
  • 4
  • 27
  • 39
5
votes
0 answers

inotify or equivalent on CIFS mount?

I'm trying to use incron or inotifywait on a CIFS share but it seems that inotify does not work with such mounts (cf. http://lists.samba.org/archive/linux-cifs-client/2009-April/004319.html). Is there an alternative to be notified of changes on a…
4
votes
1 answer

Other ways to increase max open files?

I have an application which keeps giving me the following error. tail: inotify cannot be used, reverting to polling: Too many open files I have already followed all the advice I've been able to find on web searches, and have changed the number of…
sffc
  • 417
4
votes
1 answer

Monitor /sys partition for changes

inotify doesnt work on /sys and /proc file systems. So how can I monitor a /sys partition file without polling?
3
votes
0 answers

How to monitor file changes on a Linux device using inotify and cpp?

I have cpp application running on an embedded-linux device. Now, I want the application to report if there is a change in a file on the device. I came across std::filesystem library and inotify(recommended) but couldn't fully understand how to…
Preeti
  • 141
3
votes
0 answers

NFS /usr/share breaks Policykit beause of inotify support

I just tried moving some files including /usr/share to a NFS partition to save space when running many similar virtual machines. The configuration mostly works except when starting services I think this is why $> systemctl status dbus -l ... Cannot…
spraff
  • 2,458
2
votes
1 answer

I want to execute a file every time a file changes

I have a python script that automatically ends after X amount of runs, at the start of the program it sets the value of restart.txt to 0 using this code. restart = open("restart.txt", "w") restart.write("0") restart.close() Then at the end of the…
Jaf
  • 23
2
votes
1 answer

Ignore new directories when using inotifywait to watch for new files

I'm using inotifywait to watch for new files. I would like to ignore new directories though. I can't seem to get anything to work. Here is what I'm…
2
votes
1 answer

In Linux, how do I run a program when a non-existing file inside a certain directory is attempted read?

I have a partition on a hard drive that is encrypted with dm-crypt using a passphrase. What I want to do is have a password prompt pop up when some program tries to read a file within this partitions target mount point. Eg. I normally mount my…
runeks
  • 166
2
votes
1 answer

How to clear orphaned watch descriptors of inotify

After creating a file descriptor by calling inotify_init() I add thousands of watches to the inotify instance(hope it is right to call that so). My questions is if my program crashes what happens to those watch descriptors? Can I clear them all…
destan
  • 1,157
1
2 3