注意:
There are race conditions in the recursive directory watching code which can cause events to be
missed if they occur in a directory immediately after that directory is created. This is prob-
ably not fixable.
适合少量文件监控
#!/bin/sh
src=/home/hanyh/workspace/shell
inotifywait -mrq --timefmt '%d/%m/%y %H:%M' --format '%T %w%f' \
-e modify,delete,create,attrib \
${src} \
| while read file
do
echo "${file} was monitored"
done
There are race conditions in the recursive directory watching code which can cause events to be
missed if they occur in a directory immediately after that directory is created. This is prob-
ably not fixable.
适合少量文件监控
#!/bin/sh
src=/home/hanyh/workspace/shell
inotifywait -mrq --timefmt '%d/%m/%y %H:%M' --format '%T %w%f' \
-e modify,delete,create,attrib \
${src} \
| while read file
do
echo "${file} was monitored"
done