The tag has no wiki summary.

learn more… | top users | synonyms

3
votes
1answer
35 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 ...
3
votes
2answers
110 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
28 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 ...
3
votes
0answers
46 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 ...
0
votes
0answers
45 views

get time of file in inotifywait tool

for this script: inotifywait -m /path -e create -e moved_to | while read path action file; do echo "The file '$file' appeared in directory '$path' via '$action'" # do something with the ...
0
votes
0answers
26 views

Inotify notifies only single change

I set the inotify_add_watch to watch /dev/disks. The entries in this directory are: by-id and by-uuid. When I plug-in a pen-drive, this directory gets added with two more directories: by-path and ...
5
votes
1answer
177 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 ...
1
vote
2answers
65 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
73 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 ...
4
votes
1answer
63 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: ...
3
votes
1answer
124 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
65 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 ...
6
votes
1answer
229 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
240 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
219 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 ...
2
votes
0answers
42 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
107 views

“inotifywait” to watch several dirs simultaneously

I want to trigger action, when in one of specified dirs new file will be created. I want to use inotifywait for this purpose. But the problem is that I don know how to use inotifywait to watch several ...
2
votes
0answers
117 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
138 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
224 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
86 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 ...
4
votes
2answers
2k 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
735 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
150 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
1k 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
1k 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
73 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 ...
1
vote
2answers
3k 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 ...
3
votes
1answer
358 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) ...
6
votes
1answer
2k views

Why are inotify events different on an NFS mount?

Some time ago I noticed that the events reported by inotify are different when the file is saved to an NFS mount vs. a local file system. Shouldn't the underlying VFS provide a uniform view of file ...
4
votes
2answers
874 views

Inotifywait for large number of files in a directory

What I want to do is, to monitor a directory (not recursive, just one) for new files created and append those files to one single big file as they are being written. The number of files that are ...
1
vote
0answers
61 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 ...
3
votes
1answer
658 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 ...
3
votes
1answer
194 views

No output from inotifywait | awk

I'm attempting to use part of a one-liner found here: Script to monitor folder for new files? When I try the following procedure I get no output whatsoever and I cannot figure out why. In terminal ...
2
votes
0answers
116 views

Can I limit the number of inotify watches available to a process or cgroup?

I am consistently running out of inotify resources, leading to errors along the lines of: # tail -f /some/files tail: inotify resources exhausted tail: inotify cannot be used, reverting to polling ...
7
votes
1answer
1k views

Does inotify fire a notification when a write is started or when it is completed?

Imagine two processes, a reader and a writer, communicating via a regular file on an ext3 fs. Reader has an inotify IN_MODIFY watch on the file. Writer writes 1000 bytes to the file, in a single ...
2
votes
1answer
71 views

App which can execute arbitrary code on different events

I've been looking for a simple activator which can execute some code when stuff happens, I haven't found anything yet. Maybe, I am not using the right keywords. It would be great if someone pointed me ...
4
votes
1answer
502 views

Efficiency of lots of inotify watches or stat calls

I am developing software that will utilize inotify to track changes on a large amount of files (tens to hundreds of thousands of files). I have come up with these ideas: one watch per file one watch ...
23
votes
4answers
7k 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 ...
21
votes
1answer
11k 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 ...