Questions tagged [inotify]
The inotify tag has no summary.
209 questions
1
vote
0
answers
20
views
Trying to get ClamAV clamonacc on Linux VM host monitoring the Docker overlay2 file system on the host
I've been trying to get ClamAV's clamonacc on-access scanner to monitor the overlay2 file system where Docker container file systems are mounted on my Linux (Ubuntu 24.04) VM, so that I can detect any ...
0
votes
0
answers
195
views
monitoring millions of files in linux with fanotify
I have a rather unique setup:
Proxmox setup with 2x fileservers (Debian 12), running DRBD for redundancy, XFS as the main data filesystem and then an NFS share set up for our 6 node cluster to access. ...
1
vote
1
answer
251
views
How to check for changes on mounted nas if entr and inotify fail?
How can I detect changes on a mounted NAS?
It is mounted via fstab:
//fritz.box/FRITZ.NAS /media/fritz cifs username=foo,password=bar,vers=1.0 0 0
Since I tried entr and inotify to no avail, I'm ...
3
votes
0
answers
185
views
inotifywait --include doesn't fire for files in newly created directories. Bug (in inotifywait) or PEBKAC?
I want to run inotifywait to watch for all CREATEs of .txt files (recursively) under, let's say, the current directory. I run the following:
inotifywait -mr --event create --format '%e %w %f' --...
1
vote
2
answers
653
views
How to reliably maintain watches on edited files with inotify?
I'd like to monitor a file with inotify, and trigger some code when someone changes the content (IN_MODIFY or IN_CLOSE_WRITE), but I'm running into problems where inotify stops returning events when ...
0
votes
1
answer
235
views
inotifywait not listening to DELETE event
I'm using the following bash script to test inotifywait.
while true; do
inotifywait -r -e modify,create,delete "$DIRECTORY_TO_WATCH"
done
inotifywait is listening to created files:
/...
0
votes
1
answer
212
views
What is the best way to monitor a folder and dynamically symlink items into a different folder?
I have a second hard drive which has the following structure:
$ tree -L 1
.
├── Documents
├── Music
├── Pictures
└── Videos
I want to monitor these folders for changes and, if any, create a symlink ...
1
vote
1
answer
4k
views
sysctl: permission denied on key "fs.inotify.max_user_instances"
I'm running a docker container, in the development environment. I'm trying to set the fs.inotify.max_user_instances value.
Since inside the docker container I'm the root user, thus the sudo is not ...
0
votes
0
answers
242
views
inotify used by vscode and web service for changes in same file
I use a web server and inotify to check for files changing and posting the new content. It works well if I change the files with an ordinary editor (e.g. pluma): the changed file is posted.
If I use ...
0
votes
1
answer
361
views
inotifywait script case statement stops working after a while
I have the following bash script, run at system startup to view files dropped into the /srv/mutt directory. It works perfectly for a while but then simply stops 'seeing' files arriving in /srv/mutt.
...
0
votes
1
answer
2k
views
Use Inotifywait to handle multiple files at the same time
I'm scripting a special program to my company.
By using Inotifywait from inotify-tools, I'm watching a specific folder for new items, and as soon a new file appears, it will be encrypted with gpg and ...
2
votes
1
answer
634
views
How to "listen to" directory size changes?
I need to do some actions when a directory grows above a certain size limit.
Obviously, obtaining the size can be done with du, but a single run of du takes a long time in my case, loads the disk ...
3
votes
1
answer
2k
views
inotify detect a new file write without missing write_close event
I want to watch a file created and written in a directory by a process. I don't have access to inotifywait tool, so I'm using just the inotify library calls. I start with IN_CREATE to monitor that the ...
0
votes
1
answer
569
views
Monitor several directories for specific files' creation, every 10s
OS: Ubuntu 22.04 LTS.
Many posts deal with file monitoring. One in particular is of interest and based on inotifywait, but I don't know how to modify it for my purpose.
Objective: to monitor $HOME/{...
1
vote
1
answer
99
views
inotifywait : insert arbitrary string to output format
I want to capture inotify CLOSE_WRITE events in a directory and write CSV info to a history file.
My attempt :
#!/bin/bash
dir=/home/stephen/temp
host=$(hostname)
inotifywait -e close_write -m --...
8
votes
1
answer
2k
views
inotifywait ignoring new folders in watch directory
I am trying to use inotifywait to watch a folder (/shares/Photos) and when it detects a jpg added to the folder I need to resize it into a sub directory ($small_dir). Under the photos director there ...
0
votes
1
answer
604
views
How to intercept file descriptor of file opened with inotify or others on access?
I just finished an Operating Systems course at my University, and I want to start playing with systems level programs with Rust. One of things I'm looking for is how to intercept a file descriptor of ...
1
vote
1
answer
357
views
I need some service that trigger actions once after any file is created, modified, deleted, copied or moved
The problem is that I'm not being able to keep track of all my files and I'm also tired of not telling which ones are important and which ones are a temporary file that some random programmer decided ...
2
votes
3
answers
1k
views
How to use a pattern when doing for loop of files in directory
I'm a novice bash scripter. Need help with the following. I have a script that uses inotifywait to watch a directory. Another process will drop a csv file in nightly. The file will be of the ...
2
votes
1
answer
306
views
Notify when programs access path only via specific symlink
My HDD mountpoint was at /mnt/old, now I changed it to /mnt/new
So for seamless transition now /mnt/old is a symlink to /mnt/new.
Gradually I want all the programs to use the new mountpoint.
How can I ...
3
votes
1
answer
3k
views
How is Inotifyd different from inotifywait in term of monitoring a directory and do some post actions?
I need to monitor a directory and do some post actions based on the events happened. I am familiar with inotifywait but since we use docker based on alpine, I was thinking about is there other way to ...
1
vote
0
answers
74
views
Is there a way to get a list of every single directory watched by inotify on a system?
I'd like to obtain a complete list of what a particular program (not mine, installed as a package) is watching, because some notifications it generates make it appear to be looking at things it ...
0
votes
1
answer
327
views
Detect changes in network status on SBC running Debian using inotify?
I have Debian 10 running on a small SBC (industrialized Raspberry Pi like form factor). I have some python programs running that make use of inotify capabilities. I want to detect when the network ...
0
votes
1
answer
608
views
monitoring xinput in script
My laptop has a cracked touchscreen that the local Asus tech tells me can't be replaced, not even with a non-touch because they just don't make them anymore.
It is in all other respects a great laptop ...
2
votes
2
answers
550
views
How to use parallel with inotifywait?
I currently have this:
inotifywait -m ./input -e close_write | parallel --max-args 1 "echo {1}"
For some reason this doesn't do anything at all. The output of inotifywait is the same as ...