Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Add transfer_html.sh and plug it into the install scripts.
  • Loading branch information
EdwardSafford-NOAA committed Jan 31, 2025
1 parent 914cf99 commit 3daa22e
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 15 deletions.
23 changes: 12 additions & 11 deletions src/Radiance_Monitor/image_gen/html/install_glb.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,7 @@
#--------------------------------------------------------------------
#--------------------------------------------------------------------

echo "BEGIN install_glb.sh"
echo ""
echo ""
echo "BEGIN install_glb.sh"; echo; echo

do_cmp=0
cmp_src=""
Expand All @@ -23,7 +21,7 @@ cmp_src=""
#
echo "Do you wish to enable data plots to include comparison to"
echo " operational GDAS data, or another data source?"
echo ""
echo
echo -n " Enter YES to enable comparison plots, any other input to disable. > "
read text
short=`echo $text | cut -c1`
Expand All @@ -35,7 +33,7 @@ if [[ $short = "Y" || $short = "y" ]]; then
echo "Please specify the suffix of your comparison data source,"
echo " or just hit the return key to use the operational GDAS as "
echo " the comparison source"
echo ""
echo
echo -n " > "
read text

Expand Down Expand Up @@ -80,7 +78,6 @@ fi

PDATE=`${MON_USH}/find_last_cycle.sh --net ${RADMON_SUFFIX} \
--run ${RUN} --mon radmon --tank ${R_TANKDIR}`
echo PDATE=$PDATE

limit=`$NDATE -120 $PDATE` # 5 days

Expand All @@ -90,7 +87,7 @@ limit=`$NDATE -120 $PDATE` # 5 days

data_found=0
while [[ data_found -eq 0 && $PDATE -ge $limit ]]; do

ieee_src=`${MON_USH}/get_stats_path.sh --run $RUN --pdate ${PDATE} \
--net ${RADMON_SUFFIX} --tank ${R_TANKDIR} --mon radmon`

Expand Down Expand Up @@ -123,8 +120,8 @@ while [[ data_found -eq 0 && $PDATE -ge $limit ]]; do
done

if [[ $data_found -eq 0 ]]; then
echo Unable to locate any data files in the past 5 days for $SUFFIX
echo in $TANKverf/angle.
echo Unable to locate any data files in the 5 days from ${PDATE}
echo for ${SUFFIX} in ${TANKverf}/angle.
exit
fi

Expand Down Expand Up @@ -386,14 +383,18 @@ for file in $arrow_files; do
$NCP ${RADMON_IMAGE_GEN}/html/${file} ${imgndir}/pngs/.
done

#---------------------------
# transfer files to server
#
${RADMON_IMAGE_GEN}/html/transfer_html.sh

#------------------------
# clean up $workdir
#
cd $workdir
cd ../
rm -rf $workdir

echo ""
echo "END install_glb.sh"
echo; echo "END install_glb.sh"

exit
5 changes: 5 additions & 0 deletions src/Radiance_Monitor/image_gen/html/install_rgn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,11 @@ for file in $arrow_files; do
$NCP ${RADMON_IMAGE_GEN}/html/${file} ${imgndir}/pngs/.
done

#---------------------------
# transfer files to server
#
${RADMON_IMAGE_GEN}/html/transfer_html.sh

#------------------------
# clean up $workdir
#
Expand Down
50 changes: 50 additions & 0 deletions src/Radiance_Monitor/image_gen/html/transfer_html.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/usr/bin/bash

echo; echo " -----------------------------"; echo

echo "All html and web support files have been created."; echo
echo "Do you wish to transfer these files to the webserver now?"; echo

echo -n " Enter YES to transfer now, any other input to decline. > "
read text
short=`echo $text | cut -c1`

if [[ $short = "Y" || $short = "y" ]]; then

echo; echo
echo "Submitting transfer job"

if [[ ! -d ${R_LOGDIR} ]]; then
mkdir -p ${R_LOGDIR}
fi

transfer_log=${R_LOGDIR}/Transfer_${RADMON_SUFFIX}.log
if [[ -e ${transfer_log} ]]; then
rm ${transfer_log}
fi

transfer_err=${R_LOGDIR}/Transfer_${RADMON_SUFFIX}.err
if [[ -e ${transfer_err} ]]; then
rm ${transfer_err}
fi

transfer_queue=dev_transfer
jobname=transfer_${RADMON_SUFFIX}

if [[ $RAD_AREA == 'glb' ]]; then
export WEBDIR=${WEBDIR}/${RADMON_SUFFIX}
else
export WEBDIR=${WEBDIR}/regional/${RADMON_SUFFIX}
fi

cmdfile="./transfer_cmd"
echo "${IG_SCRIPTS}/transfer.sh" >$cmdfile
chmod 755 $cmdfile

$SUB -q $transfer_queue -A $ACCOUNT -o ${transfer_log} -e ${transfer_err} \
-v "INCLUDE_PNGS=1, WEBSVR=${WEBSVR}, WEBUSER=${WEBUSER}, \
WEBDIR=${WEBDIR}, TANKimg=${TANKimg}" \
-l select=1:mem=500M -l walltime=30:00 -N ${jobname} ${cmdfile}

fi

1 change: 0 additions & 1 deletion src/Radiance_Monitor/image_gen/ush/RadMon_IG_rgn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,6 @@ if [[ $RUN_TRANSFER -eq 1 ]]; then

transfer_queue=dev_transfer
jobname=transfer_${RADMON_SUFFIX}
job="${IG_SCRIPTS}/Transfer.sh --nosrc ${RADMON_SUFFIX}"

export WEBDIR=${WEBDIR}/regional/${RADMON_SUFFIX}

Expand Down
11 changes: 8 additions & 3 deletions src/Radiance_Monitor/image_gen/ush/transfer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,12 @@

if [[ ${TANKimg} != "/" && -d ${TANKimg} ]]; then

if [[ ${INCLUDE_PNGS} == 1 ]]; then
exclude="--exclude 'horiz'"
else
exclude="--exclude 'horiz' --exclude '*.png'"
fi

WEBSVR=${WEBSVR}.ncep.noaa.gov

#----------------------------------------------------------
Expand All @@ -24,9 +30,8 @@ if [[ ${TANKimg} != "/" && -d ${TANKimg} ]]; then
ssh ${WEBUSER}@${WEBSVR} "mkdir -p ${WEBDIR}"
fi

/usr/bin/rsync -ave ssh --exclude *.ctl.${Z} \
--exclude 'horiz' --exclude '*.png' --delete-during --update ${TANKimg}/ \
${WEBUSER}@${WEBSVR}:${WEBDIR}/
/usr/bin/rsync -ave ssh --exclude *.ctl.${Z} ${exclude} \
--delete-during --update ${TANKimg}/ ${WEBUSER}@${WEBSVR}:${WEBDIR}/

else
echo "Unable to run rsync, TANKimg has bad/no value of: ${TANKimg}"
Expand Down

0 comments on commit 3daa22e

Please sign in to comment.