#!/bin/ksh -f # updateNDM-OB4.ksh (for OB4 -revised 11/19/04) # ( New NOAA1 server - revised 04/01/05) # revised for OB4.2 (remove as1,as2; add dx1,dx2) # # This is a potential script for updating NDM files. # Please read it and modify it as needed, depending on # what datasets require updates. # # You may need to delete these comment lines to run the script. # # the script now uses sftp to NOAA1 and will run in debug mode (-v). # the session will also request a password. # # PLEASE ADD THE NOAA1 IP ADDRESS BEFORE RUNNING THIS SCRIPT # Since start on ds1, rcp ds1 removed from $i loop (rev 2/20/04) # # LINUX updates are included (lx1, lx2, lx3, lx4, lx5) # Added dx1 dx2 px1 px2, xt1 xt2 xt3 xt4 xt5 # # Login on lx1, lx2, lx3, lx4, lx5 as fxa # Run "xhost +" so that files can be rcp'd to linux machines. # cd /awips/fxa/data (on lx1, lx2, lx3, lx4, lx5) # chmod 775 * # #login as fxa on ds1 and run this script #(Note: Don't login as root because localization won't work.) # # set -x (not used in ksh) date=`date +%Y%m%d` echo "Purge very old files" cd /awips/fxa/data rm textCategoryClass.txt.* rm textNNNhelp.txt.* rm textCCChelp.txt.* rm afos_lookup_table.dat.* rm bit_table.dat.* rm collective_table.dat.* rm maritimeStationInfo.txt.* rm metarStationInfo.txt.* rm MTR.goodness.* rm station_table.dat.* rm profilerStationInfo.txt.* rm profiler.goodness.* #rm prodList.txt prodList.txt.${date} cd /data/fxa/nationalData rm afosMasterPIL.txt.* rm ispan_table.template.* rm national_category_table.template.* rm redbookDataKeys.txt.* rm redbookDepictKeys.txt.* rm redbookProductButtons.txt.* rm redbookSurfaceMenus.txt.* rm redbookUpperAirMenus.txt.* cd /awips/fxa/bin rm redbook.purge.* echo "Backup old files" cd /awips/fxa/data cp -p textCategoryClass.txt textCategoryClass.txt.${date} cp -p textNNNhelp.txt textNNNhelp.txt.${date} cp -p textCCChelp.txt textCCChelp.txt.${date} cp -p afos_lookup_table.dat afos_lookup_table.dat.${date} cp -p bit_table.dat bit_table.dat.${date} cp -p collective_table.dat collective_table.dat.${date} cp -p maritimeStationInfo.txt maritimeStationInfo.txt.${date} cp -p metarStationInfo.txt metarStationInfo.txt.${date} cp -p MTR.goodness MTR.goodness.${date} cp -p station_table.dat station_table.dat.${date} cp -p profilerStationInfo.txt profilerStationInfo.txt.${date} cp -p profiler.goodness profiler.goodness.${date} #cp -p prodList.txt prodList.txt.${date} # change to /nationalData cd /data/fxa/nationalData cp -p afosMasterPIL.txt afosMasterPIL.txt.${date} cp -p ispan_table.template ispan_table.template.${date} cp -p national_category_table.template national_category_table.template.${date} cp -p redbookDataKeys.txt redbookDataKeys.txt.${date} cp -p redbookDepictKeys.txt redbookDepictKeys.txt.${date} cp -p redbookProductButtons.txt redbookProductButtons.txt.${date} cp -p redbookSurfaceMenus.txt redbookSurfaceMenus.txt.${date} cp -p redbookUpperAirMenus.txt redbookUpperAirMenus.txt.${date} cd /awips/fxa/bin cp -p redbook.purge redbook.purge.${date} echo "Get new files" cd /awips/fxa/data sftp .... (to noaa1) << EOF cd pub/ndm get textCategoryClass.txt get textNNNhelp.txt get textCCChelp.txt get afos_lookup_table.dat get bit_table.dat get collective_table.dat get maritimeStationInfo.txt get metarStationInfo.txt get MTR.goodness get station_table.dat get profilerStationInfo.txt get profiler.goodness lcd /data/fxa/nationalData get afosMasterPIL.txt get ispan_table.template get national_category_table.template get redbookDataKeys.txt get redbookDepictKeys.txt get redbookProductButtons.txt get redbookSurfaceMenus.txt get redbookUpperAirMenus.txt lcd /awips/fxa/bin get redbook.purge bye EOF chmod 755 /awips/fxa/bin/redbook.purge rcp -p /awips/fxa/bin/redbook.purge ds2:/awips/fxa/bin/redbook.purge remsh ds2 -l fxa chmod 755 /awips/fxa/bin/redbook.purge #setenv $WORKSTATION "xt1 xt2 xt3 xt4 xt5 ws1 ws2 ws3" for i in ds2 dx1 dx2 px1 px2 lx1 lx2 lx3 lx4 lx5 xt1 xt2 xt3 xt4 xt5 do echo ---$i--- rcp -p /awips/fxa/data/textCategoryClass.txt $i:/awips/fxa/data rcp -p /awips/fxa/data/textNNNhelp.txt $i:/awips/fxa/data rcp -p /awips/fxa/data/textCCChelp.txt $i:/awips/fxa/data rcp -p /awips/fxa/data/afos_lookup_table.dat $i:/awips/fxa/data rcp -p /awips/fxa/data/bit_table.dat $i:/awips/fxa/data rcp -p /awips/fxa/data/collective_table.dat $i:/awips/fxa/data rcp -p /awips/fxa/data/maritimeStationInfo.txt $i:/awips/fxa/data rcp -p /awips/fxa/data/metarStationInfo.txt $i:/awips/fxa/data rcp -p /awips/fxa/data/MTR.goodness $i:/awips/fxa/data rcp -p /awips/fxa/data/station_table.dat $i:/awips/fxa/data rcp -p /awips/fxa/data/profilerStationInfo.txt $i:/awips/fxa/data rcp -p /awips/fxa/data/profiler.goodness $i:/awips/fxa/data #rcp -p /awips/fxa/data/prodList.txt $i:/awips/fxa/data done echo "Do localization" for i in dx1 dx2 px1 px2 lx1 lx2 lx3 lx4 lx5 xt1 xt2 xt3 xt4 xt5 do echo ---$i--- remsh $i -l fxa /awips/fxa/data/localization/scripts/mainScript.csh -text -station done #LOGOUT TEXT WORKSTATION AND RELOGIN TO CHECK echo " After Localizing the px1, as user fxa do stopIngest.px1 startIngest.px1 After Localizing the px2, as user fxa do chmod 775 bit_table.dat stopIngest.px2 startIngest.px2 For Redbooks logon dx1 as fxa ps -ef | grep RedbookStorage kill -9 Verify that the RedbookStorage process was killed. The process ID should be different because it is automatically restarted Restart the notificationServer stopNotificationServer startNotificationServer logon to workstations and restart D2D "