awips2/rpms/awips2.upc/Installer.ldm/patch/dev/checkFileTime.pl
ucar-tmeyer a75d4a1af3 A few post-install updates that can be the defaults.
-qpidNoify.py - change the default server to always be "localhost"
-checkFileTime.pl - change the call to the qpidNotify.py script to "sudo su - awips -c" otherwise environment variables won't be correct when running the script via cron
2023-01-26 19:53:19 +00:00

36 lines
873 B
Perl

#!/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`;
}
}