From 022ae5ab586ab0642cfc945434c0345db6872189 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dirk=20M=C3=BCller?= Date: Mon, 10 Jun 2024 17:04:43 +0200 Subject: [PATCH] remember failed tasks in a separate directory --- update-tasks.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/update-tasks.sh b/update-tasks.sh index 60b7f76..a76cfcd 100755 --- a/update-tasks.sh +++ b/update-tasks.sh @@ -6,11 +6,14 @@ source credentials.sh while true; do for i in $PWD/tasks/*; do - echo "$(date): Importing $(basename $i)" - if ! python3 ./git-importer.py -c repos/.cache $(basename $i); then - mkdir -p $PWD/failed-tasks - mv $i $PWD/failed-tasks - fi + if test -f "$i"; then + echo "$(date): Importing $(basename $i)" + if ! python3 ./git-importer.py -c repos/.cache $(basename $i); then + mkdir -p $PWD/failed-tasks + mv -f $i $PWD/failed-tasks + fi + rm -f $i + fi done inotifywait -q -e create $PWD/tasks done