2013年9月15日 星期日

linux fs monitor

with linux 2.6.13 kernel version laster

check kernel configuration
grep CONFIG_INOTIFY_USER /boot/config-`uname -r`|wc –l

and then download inotifywait package

#!/bin/sh

inotifywait -mrq -e create,delete --exclude='ast-ami|swp|swx' /tmp \
| while read folder event file
        do
                echo "${event} ${file} from ${folder}"

        done

沒有留言: