The tag has no usage guidance.

learn more… | top users | synonyms

3
votes
1answer
29 views

Running Unison with incrond (inotify cron daemon)

We'd like to use unison to sync two servers. From the command line and in bash files the following command works fine: unison -batch /var/www/html/test ssh://host-2//var/www/html/test Files are ...
4
votes
3answers
125 views

Trace access to a directory tree

Situation I have a directory /home/foo on a server, and I guess that it is not needed any more. Unfortunately nobody can tell me if this directory is still needed. Goal If this directory is still ...
0
votes
1answer
35 views

How do I monitor bash_history file for manual modifications?

I am trying to create a daemon to monitor a users's bash_history file for manual modifications. In other words, if a user opens the file and modifies it, the daemon will notify this action for safety ...
0
votes
0answers
9 views

Use inotifywait to run command but only if inotifywait exits with status 0 [duplicate]

this is probably trivial. Normally I use the below to trigger a command on file event: inotifywait --event close /dir/file && my_command But will this run my_command even if inotifywait ...
8
votes
1answer
1k views

How does inotify work?

According to Wikipedia, inotify is a Linux kernel subsystem which notices changes to the file system. It replaced the previous dnotify. Programs that sync files (such as crashplan, dropbox, git) ...
1
vote
1answer
53 views

Why doesn't INotify work with `/etc/mtab` or `/proc/mounts`? [duplicate]

When I used INotify with /etc/mtab or /proc/mounts, it doesn't detect changes when things mount or unmount, even though /etc/mtab and /proc/mounts both have changed when I check manually. Why is this, ...
5
votes
3answers
257 views

Watch /tmp for file creation and prevent deletion of files? [duplicate]

I have a binary that creates some files in /tmp/*some folder* and runs them. This same binary deletes these files right after running them. Is there any way to intercept these files? I can't make the ...
1
vote
1answer
25 views

Set maximum number of processes started by incrond

I am using incrond to monitor a directory for incoming files. After each file arrives in the directory a python script is called to process it. A problem arises when the rate of incoming files is ...
1
vote
2answers
47 views

Allow one entry at a time in incron job?

I have a directory to monitor. When it is updated, I run some command via incron. When multiple files are copied in this directory, incron execute multiple commands at the same time. Is there any way ...
4
votes
2answers
147 views

Hook action on process creation

Is it possible to hook a script execution on each process creation? Essentially the equivalent of inotifywait to monitor disk activity but applied to the process table. It would be to allow to do an ...
4
votes
1answer
76 views

Prevent processing file until SCP transfer is finished

Large files are transferred to a server for processing. The server monitors a specific directory using incrond and when a new file is received the processing script is executed for that file. Because ...
0
votes
0answers
13 views

Get the event-related file name from inotifywait [duplicate]

I would like to set up inotifywait so that when an event, like a file in a directory is modified, occurs, I can run a command on that file. For example, if my file named style.css is modified and ...
1
vote
0answers
19 views

limit inotifywait output to n/sec

I have this inotifywait command watching a log file, once triggered runs some other code which takes 0.2s to complete. This works fine when the log is not being massively updated, but when there's ...
1
vote
0answers
15 views

How can I see file events of all processes matching those with keyword in path?

How can I see file events of all processes matching only those with keyword in path ? Here is my typical usecase. I'm investigating why Docker can't authorize with 3rd-party service using credentials ...
2
votes
1answer
53 views

convert a jpg file after being uploaded using inotifywait

First it is my first time writing a bash script so I apologize if this is trivial. I am trying to setup a watch so every time a jpg file is uploaded to a specific folder, it gets converted to webp ...
1
vote
1answer
162 views

Using Incrond Inotify but having issues with user groups/permissions

In the /etc/incron.allow I added both: root USER_1 Then I edited the incrontab so it looks like this: /var/www/laravel/public/js/main.js IN_MODIFY yui-compressor -o ...
70
votes
2answers
37k views

Kernel inotify watch limit reached

I'm currently facing a problem on a linux box where as root I have commands returning error because inotify watch limit has been reached. # tail -f /var/log/messages [...] tail: cannot watch ...
1
vote
1answer
129 views

Is there a way to use inotify on remote filesystems (specifically WebDAV)?

I have Box.com successfully mounted with davfs2 (webdav) to a local location. Now I am trying to trigger actions on files created and synced in the Webdav folder. Unfortunately this is not working. I ...
0
votes
1answer
2k views

“inotifywait” to watch several directories simultaneously

I want to trigger an action, when in one of my specified directories, a new file is created. I want to use inotifywait for this purpose. But the problem is that I don't know how to use inotifywait to ...
0
votes
0answers
57 views

recursive inotify doesn't notice subdirectories created by mkdir -p when creating multiple levels at once

I was doing some testing and ran inotifywait --recursive --monitor dirname then created multiple levels of subdirectories under dirname: mkdir -p dirname/a/b/c inotifywait only reported on the ...
2
votes
0answers
94 views

Understanding inotifywait, pipes and buffers

I want to monitor every file change in a directory with inotifywait. inotifywait shall write to a FIFO buffer, which then can be read, leisurely. While experimenting with relatively huge amounts of ...
0
votes
1answer
47 views

How to make PDF viewer responsive to changes in Debian

I have a fresh Debian 8.1 installation and am trying to make its usability feel like OSX. I run xelatex document.tex && evince document.pdf & but it only successfully runs xelatex and ...
1
vote
1answer
108 views

incrontab reports modifying a file that doesn't exists

I have created this incrontab entry: /tmp IN_ALL_EVENTS /home/me/changes.sh $@/$# $% and this script (changes.sh): #!/bin/bash echo "file $1 changed(flgs: $2)" >> /home/me/changes.log ...
5
votes
1answer
2k views

Httpd : no space left on device

I am using Fedora 17 and over the last few days I am having an issue with my system. Whenever I try to start httpd it shows me: Error: No space left on device When I execute systemctl status ...
5
votes
1answer
380 views

Using inotifywait along with vim

I have simple script that monitors file for changes and rsyncs it with remote copy: #!/bin/bash while inotifywait -e close_write somefile do rsync somefile user@host.domain:./somefile done It ...
2
votes
2answers
915 views

Execute CURL command only once in script?

To explain a little, I am currently monitoring a folder for any changes and when changes are detected it simply uploads the detected files to my server via rsync. This is working without any issues : ...
0
votes
1answer
251 views

Problem with inotify-wait as daemon

I have been running inotify-wait on my ftp server in byobu to monitor a folder, move data, and send email notifications for a few months without problems. Since I started this I have added 3 more ...
5
votes
1answer
223 views

How to create a fake inotify event on debian?

I have a dedicated box running minidlna on Debian sourcing media files from a shared cifs drive. When I add a new file to the share not using the midia box, minidlna does not recognize the new files ...
5
votes
1answer
476 views

Is it possible to create a non-empty file without write_close and rename event?

The reason why I am asking is because I'm using iwatch (not to confuse with a gadget device) to watch for filesystem events (in my case - file creation/renaming). What I cannot explain is this log: ...
0
votes
2answers
371 views

inotifywait invalid option -d (daemon)

I'm trying to run inotifywait as daemon by this command: root@server:/# inotifywait -mrd -e delete -e delete_self -e create -e moved_from -e moved_to /path -o /tmp/path.log But I'm getting this ...
2
votes
0answers
132 views

Higher-level wrapper for entr or inotifywait

I'm looking for a way to rerun a specific command as soon as any of the files in a subdirectory (perhaps minus selected excludes) changes. Use case I'm working on a project that is self-contained in ...
5
votes
1answer
129 views

tail -f produces no output in Ubuntu live CD

For some test I start Ubuntu Live from USB. I'm trying to use tail command to show debug log, but it doesn't work. I also test opening two terminals (t1, t2) with this code: t1: touch a t2: ...
2
votes
1answer
153 views

Bash script to detect uploaded files triggers many times for one file

I have a simple bash script setup that uses the built-in inotify daemon running CentOS 6.6. The script will simply echo the file that is upload to a specific directory. The script works but it echos ...
3
votes
2answers
705 views

Execute command after inotifywait established watches

Inside shell script (test.sh) I have inotifywait monitoring recursively some direcotry - "somedir": #!/bin/sh inotifywait -r -m -e close_write "somedir" | while read f; do echo "$f hi"; done When I ...
0
votes
0answers
350 views

Use inotify to detect what FTP user changes a file for revision history?

I've set up inotify using incron to detect if a file in the web root is changed. I'm using the triggers IN_MODIFY and IN_MOVED_TO and when it triggers, a bash script copies the file to a specific ...
4
votes
4answers
12k views

Killing a shell script running in background

I have written a shell script to monitor a directory using the inotifywait utility of inotifyt-tools. I want that script to run continuously in the background, but I also want to be able to stop it ...
35
votes
5answers
13k views

Who's consuming my inotify resources?

After a recent upgrade to Fedora 15, I'm finding that a number of tools are failing with errors along the lines of: tail: inotify resources exhausted tail: inotify cannot be used, reverting to ...
4
votes
2answers
10k views

Use inotifywait to move file when it loads in dropbox folder

I'm trying to find a way to immediately move a file to another folder as soon as it appears in my dropbox on CentOS. I have scoured the internet for some clues but I can't get any further than the ...
0
votes
0answers
333 views

inotifywait to monitor shared directory on laravel homestead

I need to watch a directory that is shared on a network for new files. I used inotifywait from inotify-tools and it is great except when the file is added from the other place. For example: I am ...
8
votes
1answer
5k views

Why doesn't inotifywatch detect changes on added files?

I'm trying to monitor my /tmp folder for changes using inotifywatch: sudo inotifywatch -v -r /tmp After creating couple of files (touch /tmp/test-1 /tmp/test-2), I'm terminating inotifywatch (by ...
5
votes
1answer
732 views

inotifywait - get old and new file name when renaming

I'm looking for a reliable way to detect renaming of files and get both old and new file names. This is what I have so far: COUNTER=0; inotifywait -m --format '%f' -e moved_from,moved_to ./ | while ...
5
votes
2answers
893 views

How can I detect a user login programmatically? [duplicate]

I am developing a small daemon program which needs to run some instructions when a user logs onto the system (all kinds of logins included). In order to do so, I want my program to be woken up ...
1
vote
1answer
154 views

inotifywait - no events triggered [closed]

I'm using Linux Mint 17 - Xfce desktop. I want to write a simple bash script to encrypt/decrypt files using gpg. I want to encrypt a specific file whenever it is closed/saved. But inotifywait gets ...
4
votes
0answers
601 views

Can inotify be used to watch for a specific file to be created without monitoring the entire directory?

I want to be notified when a specific filename is created. I'm looking at inotify. The IN_CREATE flag is available for monitoring a directory for any changes within it, but I'd prefer not to monitor ...
5
votes
2answers
3k views

inotify and rsync on large number of files

I am using inotify to watch a directory and sync files between servers using rsync. Syncing works perfectly, and memory usage is mostly not an issue. However, recently a large number of files were ...
2
votes
2answers
543 views

Will incron's IN_CREATE event give me a blank file?

I want to monitor a directory for new files, which will be created by another process. I plan to use incrod to do this. I am not interested in reacting to changes in files, as the files should never ...
5
votes
1answer
1k views

How do I use inotify or named pipes over SSHFS?

Thanks sshfs magic, I can mount my home dir from a remote server with sshfs user@server:/home/user ~/remote Optimistically, I thought I'd set a local inotify-hook on ~/remote/logFile (in the sshfs ...
0
votes
0answers
166 views

inotify does not work with linux kernel 3.4.11

I have a Linux running with kernel 3.4.11. I tried to run inotify-tools, but it does not work (in fact it does not detect the file changes). I checked the .config file of Linux kernel and I found ...
8
votes
1answer
3k views

Using inotify to monitor a directory but not working 100%

I have written a bash script to monitor a particular directory /root/secondfolder/: #!/bin/sh while inotifywait -mr -e close_write "/root/secondfolder/" do echo "close_write" done When I ...
3
votes
0answers
157 views

How does fsnotify setting affect system performance?

Occasionally a software package I install complains that the default fsnotify setting is far too low for decent performance. Intellij IDEA or crashplan are two examples. They suggest using fsnotify ...