From f2125e071858867998b2f13a8d04775eb5366a5d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Sachse?= <joerg.sachse@slub-dresden.de> Date: Fri, 11 Nov 2022 15:42:15 +0100 Subject: [PATCH] fix: replace inotify mechanism with infinite loop, because inotify can't handle mixed mode shares, as they don't trigger inotify events. --- validate_workflow.sh | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/validate_workflow.sh b/validate_workflow.sh index 13f0524..bd87419 100755 --- a/validate_workflow.sh +++ b/validate_workflow.sh @@ -545,14 +545,17 @@ else # TODO: protect DAEMON from STRG-C for clean shutdown # echo daemon mode, use inotify to watch changes debug "starting daemon" - scan_dir "$WATCH_FOLDER" # to clean up existing files - /usr/bin/inotifywait --monitor --recursive --event create \ - --event attrib --event moved_to --format "%w%f" "$WATCH_FOLDER" \ - | while read -r filename; do - debug "called inotifywait using /usr/bin/inotifywait --monitor - --recursive --event create --event attrib --event moved_to --format '%f' $WATCH_FOLDER" - scan_file "$filename" - done + while [[ 1 ]]; do + scan_dir "$WATCH_FOLDER" # to clean up existing files + sleep 10 + done +# /usr/bin/inotifywait --monitor --recursive --event create \ +# --event attrib --event moved_to --format "%w%f" "$WATCH_FOLDER" \ +# | while read -r filename; do +# debug "called inotifywait using /usr/bin/inotifywait --monitor +# --recursive --event create --event attrib --event moved_to --format '%f' $WATCH_FOLDER" +# scan_file "$filename" +# done debug "stopping daemon" else # cli mode, scan watch folder once -- GitLab