diff --git a/rpms/awips2.upc/Installer.ldm/patch/cron/awips b/rpms/awips2.upc/Installer.ldm/patch/cron/awips index 59f8287632..3fe285d633 100644 --- a/rpms/awips2.upc/Installer.ldm/patch/cron/awips +++ b/rpms/awips2.upc/Installer.ldm/patch/cron/awips @@ -7,7 +7,7 @@ # ascat grib2 #10 * * * * /awips2/ldm/bin/ascat_grib.sh >& /dev/null 2>&1 */5 * * * * /bin/perl /awips2/ldm/dev/purgeRadar.pl >>/awips2/ldm/dev/logs/purgeRadar.log 2>&1 -*/2 * * * * /bin/perl /awips2/ldm/dev/checkFileTime.pl >>/awips2/ldm/dev/logs/checkFileTime.log 2>&1 +*/2 * * * * bash -l /awips2/ldm/dev/checkFileTime.sh >>/awips2/ldm/dev/logs/checkFileTime.log 2>&1 30 3 * * * /bin/perl /awips2/dev/updateNDM.pl >>/awips2/dev/logs/updateNDM.log 2>&1 # LDM-6.8.1+ metrics gathering diff --git a/rpms/awips2.upc/Installer.ldm/patch/dev/checkFileTime.pl b/rpms/awips2.upc/Installer.ldm/patch/dev/checkFileTime.pl deleted file mode 100644 index 45fcb0c435..0000000000 --- a/rpms/awips2.upc/Installer.ldm/patch/dev/checkFileTime.pl +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/perl - -#$path="/awips2/data_store/grid"; - -@paths=("/awips2/data_store/grid","/awips2/data_store/modelsounding"); -foreach $path(@paths) -{ - -#find files that haven't been touched in the past 5 minutes - $syscmd="find $path -name \"*-concat-*\" -mmin +2"; - - print "\t$syscmd\n"; - - @output=`$syscmd`; - - foreach $line(@output) - { - chomp $line; - if($line!~/\/staging\//) { next; } - @dirs=split(/\//, $line); - $outPath=""; - for($i=0; $i<$#dirs-1; $i++) - { $outPath.=$dirs[$i]."/"; } - $file=$dirs[-1]; - - $syscmd = "mv $line $outPath"; - print "\t$syscmd\n"; - `$syscmd`; - - # $syscmd=" /awips2/python/bin/python /awips2/ldm/dev/notifyAWIPS2-unidata.py $outPath/$file"; - $syscmd="sudo su - awips -c \"/awips2/python/bin/python /awips2/fxa/bin/src/qpidNotify/qpidNotify.py $outPath/$file\""; - - print "\t$syscmd\n"; - `$syscmd`; - } -} diff --git a/rpms/awips2.upc/Installer.ldm/patch/dev/checkFileTime.sh b/rpms/awips2.upc/Installer.ldm/patch/dev/checkFileTime.sh new file mode 100755 index 0000000000..223d01616b --- /dev/null +++ b/rpms/awips2.upc/Installer.ldm/patch/dev/checkFileTime.sh @@ -0,0 +1,32 @@ +#!/bin/bash +# +# Concatenate grib and bufr files before ingesting them into edex +# to reduce the number of jobs edex processes +# +# Author: srcarter@ucar.edu +# Author: tiffanym@ucar.edu +# +# Updates +# Jan 12, 2024 - First stab at translating from our existing perl script +# +# + +# We want to concatenate grib and bufr files +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 + +# echo ${#files[@]} + for file in "${files[@]}"; + do + /awips2/python/bin/python /awips2/ldm/dev/notifyAWIPS2-unidata.py $file +# /awips2/python/bin/python /awips2/fxa/bin/src/qpidNotify.py $file + echo $file + done +done +