Skip to content

Instantly share code, notes, and snippets.

@moomindani moomindani/dirmon.sh

Created Jun 15, 2014
Embed
What would you like to do?
Monitoring directory using inotifywait
#!/bin/sh
/usr/bin/inotifywait -e create,delete,modify,move,attrib \
-mrq /etc | while read line; do
echo $line | tee -a /var/log/dirmon.log
dirmon_count=`cat /tmp/dirmon_count`
echo `expr $dirmon_count + 1` > /tmp/dirmon_count
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.