New implementation using Python and "watchdog"

This version collects the events in a separate thread, and doesn't gobble up events. So hopefully it's more robust, in
addition to being easier to read.

One downside of using the "watchdog" module is that it only exposes file/dir modification events. So if I ever want to
keep track of opened files, I'll have to call inotifywait again.
This commit is contained in:
David Coppit
2017-04-01 23:23:05 -04:00
parent d0b25a4ed4
commit 7ed3d92e8b
4 changed files with 297 additions and 248 deletions

View File

@@ -27,7 +27,7 @@ PIDS=()
for CONFIG_FILE in "${CONFIG_FILES[@]}"
do
echo "$(ts) Launching monitor for $CONFIG_FILE"
/files/monitor.sh $CONFIG_FILE &
/files/monitor.py $CONFIG_FILE &
PIDS+=($!)
done