Tools needed:

sudo apt-get install inotify-tools

Example script:

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

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:

inotifywait -r -m /media/usbdisk/


Source: http://www.noah.org/wiki/Inotify,_FAM,_Gamin

indexes/watch_filesystem_activity_with_inotify.txt · Last modified: 2011/04/25 11:23 by domingo
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Share Alike 3.0 Unported
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki