The tag has no usage guidance.

learn more… | top users | synonyms

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
17 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
12 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
43 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 ...
3
votes
1answer
41 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
71 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
24 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
64 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
124 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
222 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 ...
1
vote
2answers
414 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
46 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
376 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
233 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 ...
4
votes
1answer
282 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
103 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 ...
0
votes
0answers
15 views

logging file system events (like read, write, access file/directory) [duplicate]

I want to get file system events on my arch linux local host, and don't get how to make it. I want to tail throw the logs of file system events to see what processes making changes to my system in ...
2
votes
1answer
129 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
282 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
591 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 ...
3
votes
4answers
7k 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
271 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
197 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 ...
6
votes
1answer
4k 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
573 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 ...
4
votes
2answers
742 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
137 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
481 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
473 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
154 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
123 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
2k 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
182 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 ...
2
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
109 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
1k 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
261 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
254 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
573 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 ...
3
votes
0answers
152 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 ...
8
votes
2answers
8k views

Is there any way to use xargs across a pipe?

I'm trying to automatically convert flac files moved to a folder into mp3 in another folder. My current line of code is this: inotifywait -m -r -q -e moved_to --format "'%w%f'" ~/test | xargs -I x ...
5
votes
2answers
2k 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
1answer
260 views

Incrontab doesn't detect modifications on a s3fs mount

This is my incrontab line: /srv/www IN_MODIFY,IN_ATTRIB,IN_CREATE,IN_DELETE,IN_CLOSE_WRITE,IN_MOVE rsync --quiet --recursive --links --hard-links --perms --acls --xattrs --owner --group --delete ...
5
votes
2answers
3k views

Notify of changes on a file under /proc

I have written a small 'daemon' in bash that will switch to the headphones if they are detected, and if not, switch to an external USB speaker with PulseAudio. What I'm looking for is some way to get ...
2
votes
2answers
8k views

Monitoring file locks, locked using flock

I would like to get a list of pid's which hold shared lock on /tmp/file. Is this possible using simple command line tools?
2
votes
1answer
95 views

Monitoring file reads for cache warming

After adding more memory to my Linux machine I was tempted to use the cache more agressively. The thing is: I boot up my machine, go to bathroom, come back and log in. It takes like half a minute to ...
3
votes
2answers
8k 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 ...