Questions tagged [inotify]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
2answers
23 views

With inotifywait, exclude files that have certain extensions

I am watching incoming encrypted files which have two extensions, e.g., testfile<date>.dat.pgp. The problem is: once the file is decrypted, it creates a new file (testfile<date>.dat) in ...
0
votes
0answers
23 views

Monitor and execute with inotifywait but do it in a queue

I have a rtorrent + rutorrent setup which will move downloaded torrent content to ~/rtorrent/completed using autotools plugin. Inotifywait in background checks any new files that appears on ~/rtorrent/...
0
votes
2answers
43 views

Split behaving weird in bash

Trying to use split with inotifywait which basically splits the file when the file is created from ftp-server. #!/bin/bash TARGET=/home/test-directory/incoming SPLITTED=/home/test-directory/...
1
vote
0answers
44 views

Inotifywait not working on folders mounted via fstab

I'm trying to watch a folder via inotifywait which is mounted via fstab and originally located on an extern NAS. Inotifywait is reacting on any change done by SFTP-Connection or directly via terminal, ...
0
votes
2answers
86 views

Reliability of inotifywait loop

I have of bash script with a loop watching a directory recursively: while true do if path=`inotifywait -q -r -e create --format %w%f $watchpath`; then #modify file fi done If I'm not ...
1
vote
0answers
36 views

Do inotify watches automatically stop when a program ends?

Per man 7 inotify, there are a limited number of inotify instances (/proc/sys/fs/inotify/max_user_instances) and watches (/proc/sys/fs/inotify/max_user_watches). If inotify is set up using ...
1
vote
0answers
71 views

inotify stops reporting events

I am using inotify in a program written in C; it closely follows the example in man 7 inotify. The steps are essentially: /* setup */ int fd = inotify_init1(IN_NONBLOCK); int wd = inotify_add_watch(...
2
votes
1answer
468 views

What is exactly difference between INotify max_user_instances and max_user_watches?

After reading some articles on the internet I am a little lost in understanding the difference between INotify max_user_instances and max_user_watches. From official Linux man: /proc/sys/fs/...
0
votes
0answers
174 views

Use inotifywait to monitor folders and run script on a file when found

I am hoping someone could help me out. I am using a script that when pointed at a certain file in a folder, will generate a json file in that same folder. Below is the command used to run the script ...
0
votes
1answer
44 views

Process waiting for input from other process

I need to have a mechanism wherein 2 process should communicate. Process A will do some job and wait for input [file path] from another process B. Each time Linux machine is rebooted this should ...
0
votes
0answers
37 views

Continuously detect a change of chksum of files under folder with inotify-tools [duplicate]

I just installed inotify-tools. I would like to continuously detect change of chksum of files under folder /path Once a change was detect ( under /path ) then it will print echo “chksum of files ...
5
votes
1answer
67 views

How can I find what a process is trying to watch using strace, lsof, and fdinfo?

I have a process (the NewRelic infra agent) that is hung on a RHEL 7, xfs filesystem host. I'm thinking that it's trying to watch a file or maybe a socket that another process already has in use. ...
0
votes
1answer
56 views

Data partition and IntelliJ IDEA external file sync speed

I recently reconfigured the filesystem on my laptop so I can share my data with a second Linux. The Linux used in this matter is Fedora 28, 64-bit. My disks are now laid out like so: /dev/sda: /dev/...
2
votes
1answer
28 views

Alert or execute script, only if config file shows not in production mode

I would like to test the software in development by running a particular script, say script file.ext. But I was told that I an not allowed to run the script if a config file, say file.conf, contains a ...
2
votes
0answers
42 views

lsyncd: big directories

My plan was to use lsyncd to synchronize a directory with about 1,5m files and 0,3m directories to another host. Performance is not most important. After first tests I see that lsyncd uses inotify ...
1
vote
2answers
211 views

What is this `gmain` process with these unknown PIDs in my trace file?

Reading up on an answer to find out which process registered inotify watchers, I executed the following commands echo 1 | sudo tee /sys/kernel/debug/tracing/events/syscalls/...
1
vote
0answers
47 views

tail reopen file when directory changes

I've got a symlink pointing to the "latest" directory, and I want to tail a file in the latest directory, even if the symlink changes to a newly created directory. I often use tail -F for files and ...
5
votes
2answers
2k views

how to get the number of inotify watches in use

I use inotifywait for event trigger which put file. When many files are watched by inotifywait, when max_user_watches is exceeded, the following error occurs. Terminating since out of inotify ...
0
votes
1answer
38 views

finding a way to wait for an unknown named file to appear in a directory and then doing something with it

I have a dir called /media/simc/, I want to to set something up to monitor /media/simc/, and when a file is put in it (from this machine or any other on the network, it is a network mounted dir itself)...
0
votes
1answer
279 views

webpack dev server leading to freezing of the system

I was getting errors on using npm start in my react application. which goes like this ENOSPC system limit for file watcher reached I updated my npm and node versions but still i was getting this ...
2
votes
1answer
319 views

Source of this error: udevd [ PID ]: inotify_add_watch(6, /dev/sda, 10) failed: operation not permitted

We have this log in our syslog: udevd [ PID ]: inotify_add_watch(6, /dev/sda, 10) failed: operation not permitted Why do we get this error and how do we solve it? Our environment: Ubuntu 12.04; LXC;...
1
vote
0answers
136 views

inotifywait not working with Visual Studio Code

I tried to make myself a small shell script that would watch for file changes using inotifywait and copy modified/created files and delete deleted files to some destination folder (or rsync specific ...
0
votes
1answer
845 views

How would I use inotifywait to execute a command if a file in a directory is created, deleted or modified?

Here is the shell script I've got so far. I want it to check recursively, hence the following options: -r for recursive -m for monitoring -e for event notification and tracking For a reason unknown ...
0
votes
1answer
199 views

initifywait --exclude does not fire when there is at least one not excluded file

I am using this command to watch a directory: inotifywait -r -e modify,create,delete --exclude ".*(\.(git|idea)|(.*(___jb_tmp___|___jb_old___)))" my-dir However, it does not work like I intend. What ...
3
votes
1answer
234 views

Call a command, wait, then execute another command

This feels like a situation where I need to watch a stream (stdin), if a line comes in, wait a moment, then fire the command and wait some more. Using a tool like pyinotify or fswatch, we can watch ...
0
votes
1answer
90 views

How to read only the last line of a live input stream in a while read loop

I have a very simple bash script that synchronizes data to a USB key as soon as new files appear. It is poorly written but it works, however I want to minimize CPU time so I used sleep but since I use ...
4
votes
0answers
1k views

Alternative to inotifywait which allows easy working on *.json files only

It seems that inotifywait works with exclude lists only. I have seen the workarounds, but don't like them: How to use inotifywait to watch a directory for creation of files of a specific extension ...
0
votes
1answer
27 views

How to process series of files once transfer complete

What I have I have 2 servers. Lets call them sen.der and recei.ver. Sender generates files; these files can range in size from a 20Kb to 30 Gb. I've written a script that checks to see how big the ...
0
votes
0answers
376 views

How can I stop a running inotifywait from another script?

I have a script that starts up a perpetual inotifywait session (using the -m switch) that monitors a directory waiting for backup files to drop in and then moves them to another directory where they ...
2
votes
2answers
336 views

Have `xargs` run the arguments it's received every <maximum amount of time> instead of every `-n` arguments?

I am using fswatch and xargs to watch for file system changes, and run commands depending on which files are changing. fswatch prints the changed files to stdout, and xargs <my command> ...
2
votes
0answers
47 views

How to stop nginx sending status code partially written files to browsers? [closed]

I'm uploading video files to my Nginx server at /var/www/static. The files are sent from a separate machine. Sometimes these are large files, but are typically sent via an internal network. For ...
2
votes
1answer
949 views

Can't monitor Dropbox folder

I recently installed Dropbox on my computer running Debian 9.3. But it will not sync. When I mouse over the icon in the notification area of my toolbar, a message says... Can't monitor Dropbox folder ...
2
votes
2answers
571 views

How can I terminate a process if a second inotify event occurs?

inotifywait -q -m -e close_write,create --recursive ../orgmode-parse-print | while read -r filename event; do echo $filename; echo $event sleep infinity; done The problem with the above ...
0
votes
1answer
182 views

Shell: straightforward if statement seems not working

I've written this shell script snippet: while inotifywait -e modify $ENV_LOCATION/*.env do md5sum $ENV_LOCATION/*.env > ./checksums_optwo.md5 if [ -n "$(cmp ./checksums_opone.md5 ./...
2
votes
1answer
2k views

inotifywait exclude file types

I'm using inotifywait in a script and wondering if there is a way to exclude hidden files from being watched? I can't seem to determine the regex pattern to exclude hidden files.
4
votes
2answers
238 views

Potential workaround to inotifywait can't produce NUL-delimited output

I'm currently writing a bash script that uses inotifywait to perform certain actions on a user-supplied list of files and directories. It has come to my attention that unlike a lot of shell tools, ...
0
votes
1answer
145 views

Continuously transfer files to the server

I have linux client and linux server. Both are Ubuntu 16.04. On the client I generated .txt files almost every second, and I want to transfer them to the server, so my question is: what is the best ...
0
votes
2answers
58 views

Removing files under ~5k

I have 12 directores: /home/imp/hpt/boxes/110.110.2.0/ /home/imp/hpt/boxes/115.115.16.0 /home/imp/hpt/boxes/1.154.10.0/ /home/imp/hpt/boxes/44.100.0.0/ /home/imp/hpt/boxes/46.1.100.0/ /home/imp/hpt/...
2
votes
0answers
1k views

Failed to start Apply Kernel Variables

This is fragment of journalctl result: Jan 09 12:37:26 Host systemd[1]: Starting Apply Kernel Variables... Jan 09 12:37:26 Host systemd-sysctl[329]: Couldn't write '65536' to 'fs/inotify/...
0
votes
2answers
188 views

Inotify to duplicate the file from a directory that has been updated

I'm working on a system to backup logs. I need to copy logs in an other path in order to backup. I found inotify (that i do absolutely not know) that should help me on this task but i'm not sure... I ...
0
votes
1answer
558 views

Shell script to monitor windows directory

I need shell script to monitor the windows shared drive directory for any new file from the linux box and process the new file for further validation. I wrote the script using inotify-wait, but it ...
1
vote
2answers
92 views

What is mean of “not explicitly being listened” on manual page of inotifywait?

man inotifywait: delete_self A watched file or directory was deleted. After this event the file or directory is no longer being watched. Note that this event can occur even if it is not ...
0
votes
1answer
123 views

Check whether a file is opened or not

I have a folder, inside of which there are a lot of files. I was looking for a way to check whether any file inside that folder has been opened or not. If it is open, I need to get notified. I know ...
2
votes
2answers
2k views

inotifywait not alterting when device created

This works perfectly: $ inotifywait --event create ~/foo Setting up watches. Watches established. /home/ron/foo/ CREATE bar However, this just sits there when directory tun0 is created under /sys/...
1
vote
1answer
91 views

System unable to detect renamed/new files

Some months ago I realized when I am writing a new post on my blog (with Hugo), the feature to reload the contents as files changes stopped working. I waited in order to see if it was a problem with ...
5
votes
4answers
2k views

Monitor a burst of events with inotifywait

I have a service which is sporadically publishing content in a certain server-side directory via rsync. When this happens I would like to trigger the execution of a server-side procedure. Thanks to ...
1
vote
0answers
607 views

inotifywait and rsync is printing temporary file names

I am in the process of writing a bash script that will make a POST request to a remote server every time a new file is created in a directory. I use RSYNC to sync several directories to a main ...
6
votes
2answers
4k views

List current inotify watches (pathname, PID)

How do I get a list of: Pathnames currently being watched by inotify, and PID of the process watching I ask because I have found that syncthing's inotify watches were preventing my disk from being ...
1
vote
0answers
805 views

inotifywait script to watch file indefinitely, and restart process needs advice

I'm trying to write a script that will restart a process when the application configuration file is written to, using inotify. The script is supposed to act differently depending on which host it is ...
2
votes
2answers
1k views

systemd-path service not working

I have added a systemd service to monitor a path, but it is not working. I touched a .txt file under /tmp/test/, but it is not kicking in my service. I can't see "/tmp/testlog.txt" getting generated. ...