From 0cf06778bb611456072b05b2bd6901690c88a529 Mon Sep 17 00:00:00 2001 From: James Armstrong <32995055+jmarmstrong1207@users.noreply.github.com> Date: Thu, 25 Jul 2024 02:16:09 -0700 Subject: [PATCH] Instead of inotifywait using "create" (which will error out when it tries to import a file in the middle of a transfer/download), use close_write to detect when files are done writing and moved_to for detecting files moved rather than copied into the dir --- Automatically-import-new-books-(Linux).md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Automatically-import-new-books-(Linux).md b/Automatically-import-new-books-(Linux).md index bf711e5..0fead16 100644 --- a/Automatically-import-new-books-(Linux).md +++ b/Automatically-import-new-books-(Linux).md @@ -54,7 +54,7 @@ add_to_calibre() { } # Monitor the folder for new files -inotifywait -m -e create -e moved_to "$WATCH_FOLDER" | +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"