The tag has no usage guidance.

learn more… | top users | synonyms

3
votes
1answer
34 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 ...
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 ...
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 ...
1
vote
1answer
54 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
258 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
26 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
48 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
150 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 ...
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
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 ...
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 ...
2
votes
1answer
55 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
134 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
0answers
63 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
96 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 ...
1
vote
1answer
163 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 ...
0
votes
1answer
253 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 ...
2
votes
2answers
921 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
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 ...
5
votes
1answer
477 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
374 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 ...
5
votes
1answer
388 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
0answers
134 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 ...
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 ...
0
votes
0answers
353 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 ...
3
votes
2answers
711 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 ...
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 ...
0
votes
0answers
334 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 ...
5
votes
1answer
226 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 ...
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
745 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
899 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
155 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
608 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
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 ...
2
votes
2answers
546 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 ...
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 ...
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: ...
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 ...
0
votes
0answers
206 views

Why Inotify is unable to add watch

I have been trying to install teamviewer on RHEL 6 machine. The installation went fine. When I try to run teamviewer, it terminates immediately after showing the GUI. I went to ...
7
votes
1answer
2k views

mutt: automatically show new mesages

When I have mutt opened, I don't see new emails until I press a key, for example arrow down. Then new emails appear. Is there a way for mutt do recognize that new email has arrived, and display the ...
0
votes
2answers
2k views

using inotify to monitor access to a file

I would like to have a trigger and when a particular file is accessed by some process, I would like to be notified (i.e. a script should be run). If I understand correctly, this could be achieved with ...
3
votes
2answers
1k views

inotifywait different action on file or dir

I'm trying to make a inotifywait script take different actions for files vs folders if it sees a close_write flag being raised in the watched directory, but cannot seem to get the checks working. In ...
3
votes
0answers
124 views

Keep keyboard layout upon inserting external keyboard

I have a custom keyboard layout, that I enable using this commands: setxkbmap -verbose us -variant altgr-intl xmodmap -verbose /home/coub/.myxmodmap This works just fine, the thing is, that when 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 ...
2
votes
0answers
294 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
288 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 ...
2
votes
1answer
642 views

inotifywait not working when folder is deleted and re-created

I am trying to use inotifywait to monitor a folder: inotifywait -m -r /home/oshiro/Desktop/work_folder The command works and if I create files in that folder, all seems to work correctly. While ...