Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion monitor-dir.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"

# 检查是否是目录事件(创建或移动)
Expand Down