From 557958285e9351e70262fa384783f8f77fa0539a Mon Sep 17 00:00:00 2001 From: James Armstrong <32995055+jmarmstrong1207@users.noreply.github.com> Date: Thu, 25 Jul 2024 22:49:05 -0700 Subject: [PATCH] Fix script to work with subfolders --- Automatically-import-new-books-(Linux).md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Automatically-import-new-books-(Linux).md b/Automatically-import-new-books-(Linux).md index b90b58e..66889ba 100644 --- a/Automatically-import-new-books-(Linux).md +++ b/Automatically-import-new-books-(Linux).md @@ -58,10 +58,10 @@ add_to_calibre() { } # Monitor the folder for new files -inotifywait -m -e close_write,moved_to -e moved_to "$WATCH_FOLDER" | -while read -r directory events filename; do - echo "New file detected: $filename" - add_to_calibre "$filename" +inotifywait -m -r --format="%e %w%f" -e close_write -e moved_to "$WATCH_FOLDER" | +while read -r events filepath; do + echo "New file detected: $filepath" + add_to_calibre "$filepath" done ```