User Tools

Site Tools


howtos:watch_filesystem_activity_with_inotify

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

howtos:watch_filesystem_activity_with_inotify [d/m/Y H:i] (current)
Line 1: Line 1:
 +Tools needed:
 +<code>
 +sudo apt-get install inotify-tools
 +</code>
  
 +Example script:
 +<file>
 +inotifywait -mrq -e create -e modify -e delete -e attrib -e move ~/Maildir | while read file
 +do
 +  (notify-send "File updated in Maildir:" "$file"&)
 +done
 +</file>
 +
 +The script will watch the Maildir directory for file changes and send a notification to the desktop.
 +
 +To get all events just omit the event list:
 +<file>
 +inotifywait -r -m /media/usbdisk/
 +</file>
 +
 +----
 +----
 +Source: http://www.noah.org/wiki/Inotify,_FAM,_Gamin
howtos/watch_filesystem_activity_with_inotify.txt · Last modified: d/m/Y H:i (external edit)