Update crontab and checkFileTime script to be in bash instead of perl so we don't run into python environment issues

This commit is contained in:
ucar-tmeyer 2024-01-12 20:13:07 +00:00
parent 070b7cb7e7
commit 5eb7dcdb0a
3 changed files with 33 additions and 37 deletions

View file

@ -7,7 +7,7 @@
# ascat grib2 # ascat grib2
#10 * * * * /awips2/ldm/bin/ascat_grib.sh >& /dev/null 2>&1 #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 */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 30 3 * * * /bin/perl /awips2/dev/updateNDM.pl >>/awips2/dev/logs/updateNDM.log 2>&1
# LDM-6.8.1+ metrics gathering # LDM-6.8.1+ metrics gathering

View file

@ -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`;
}
}

View file

@ -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