From 44e199b02976d358dea2b4bcae50a798021167e8 Mon Sep 17 00:00:00 2001 From: ucar-tmeyer Date: Wed, 17 Jan 2024 16:58:49 +0000 Subject: [PATCH] More updates to checkFileTime.sh script to work correctly --- .../Installer.ldm/patch/dev/checkFileTime.sh | 33 ++++++++++++------- 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/rpms/awips2.upc/Installer.ldm/patch/dev/checkFileTime.sh b/rpms/awips2.upc/Installer.ldm/patch/dev/checkFileTime.sh index 7e38b643be..2fcf25a231 100755 --- a/rpms/awips2.upc/Installer.ldm/patch/dev/checkFileTime.sh +++ b/rpms/awips2.upc/Installer.ldm/patch/dev/checkFileTime.sh @@ -8,7 +8,8 @@ # # Updates # Jan 12, 2024 - First stab at translating from our existing perl script -# +# Jan 16, 2024 - Update path to qpidNotify.py +# Jan 17, 2024 - Move file out of staging directory before calling qpidNotify.py # # We want to concatenate grib and bufr files @@ -16,16 +17,24 @@ paths=("/awips2/data_store/grid" "/awips2/data_store/modelsounding") for path in "${paths[@]}"; do - # Check for relevant files that haven't been touched in the last two minutes - IFS=$'\n' - files=($(find $path -name "*-concat-*" -mmin +2 | grep "staging")) - unset IFS + # Check for relevant files that haven't been touched in the last two minutes + IFS=$'\n' + files=($(find $path -name "*-concat-*" -mmin +2 | grep "staging")) + unset IFS -# echo ${#files[@]} - for file in "${files[@]}"; - do - /awips2/python/bin/python /awips2/fxa/bin/src/qpidNotify/qpidNotify.py $file - echo $file - done + for file in "${files[@]}"; + do + # get the parent directory the staging dir is in + dir=$(dirname $file) + filename=$(basename $file) + parentDir=$(dirname $dir) + # move file to parent dir + mv $file $parentDir + + newFile=$parentDir/$filename + + echo "Running /awips2/python/bin/python /awips2/fxa/bin/src/qpidNotify/qpidNotify.py $newFile" + + /awips2/python/bin/python /awips2/fxa/bin/src/qpidNotify/qpidNotify.py $newFile + done done -