From f4e5afbfc3673eba6b65205784858ad35731e6da Mon Sep 17 00:00:00 2001 From: Ken Chou Date: Tue, 15 Jul 2025 08:59:55 +0800 Subject: [PATCH] update --- monitor-dir.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/monitor-dir.sh b/monitor-dir.sh index 1467756..cae4328 100755 --- a/monitor-dir.sh +++ b/monitor-dir.sh @@ -97,7 +97,8 @@ echo "使用文件监控工具: $watcher" if [ "$watcher" = "inotifywait" ]; then # Linux/Unix 系统使用 inotifywait - inotifywait --exclude '(.tmp)' -r -m --format '%w%f %e' -e moved_to,create "$@" | while IFS= read -r line; do + # 监控原始触发事件,不监控 create 防止手动 mkdir 目录被删除 + inotifywait --exclude '(.tmp)' -r -m --format '%w%f %e' -e moved_to "$@" | while IFS= read -r line; do echo "原始事件: $line" # 检查是否是目录事件(创建或移动)