The tag has no usage guidance.

learn more… | top users | synonyms

2
votes
1answer
308 views

Why is my inotifywait loop exiting after removing some subdirectories?

i have the following bash script: #!/bin/sh dir1=/source/dir/path/ while inotifywait -qqre modify "$dir1"; do rm -r /destination/dir/path find /source/dir/path/ -name .svn -exec rm -rf '{}' \; ...
1
vote
0answers
300 views

Incrontab does not execute command

When I use incrontab out of the box, I mean no changes, I get no result, as if the command was not executed. my incron line is : /crrae IN_CREATE,IN_CLOSE_WRITE,IN_MOVED_TO /usr/bin/unix2dos $# the ...
1
vote
2answers
59 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 ...
0
votes
0answers
30 views

Incron IN_MODIFY and IN_WRITE_CLOSE strange behavior

If i set incron to listen folder for IN_MODIFY my script launch twice. If i set IN_WRITE_CLOSE script launch when file open and file close with write. Why? script: echo `date` >>/home/zsumo/...
1
vote
0answers
28 views

incrontab on folder name containing line feeds

I'm writing a script searching for directories in a subtree and appending them to incrontab. I can even add folder names with blanks by escaping those with a backslash: /path/to/observed\ directory ...
3
votes
0answers
25 views

Share an instance of inotify between processes

I have a big folder of many (40,000+) files that are watched by at least 3 programs each one using inotify watches to detect changes (media servers, sync apps,...). Each program runs it's own ...
1
vote
1answer
49 views

inotifywait doesn't monitor Windows users saving to Samba share on Linux

I have inotifywait(version 3.14) on Linux to monitor a folder that is shared with Samba Version 4.3.9-Ubuntu. It works if I copy a file from Linux machine to samba share(that is on different machine, ...
3
votes
1answer
54 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
130 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
36 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
62 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
279 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
31 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 ...
4
votes
2answers
200 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
84 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
22 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
16 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
56 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 ...
2
votes
1answer
171 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 /var/www/laravel/public/js/main....
75
votes
2answers
40k 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 '/var/...
1
vote
1answer
149 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
111 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
111 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
48 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
112 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 httpd....
6
votes
1answer
423 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
970 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
263 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
236 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
494 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
411 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
137 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
131 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
157 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
744 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
369 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
13k 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 ...
36
votes
5answers
14k 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
347 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
6k 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
802 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
956 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
159 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
665 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 ...