ASM #113 DR 16464 rsync_parms.site may not always exist for Service Backup

Change-Id: I2abbb68dcbd064483a262ddba4b9ab9e0dee211a

Former-commit-id: 4d9b74dc181c359681eda8bae04f7c46f41d5769
This commit is contained in:
John.McPherson 2014-03-04 17:24:00 +00:00
parent 4bc91be899
commit 2d8ce4e577
4 changed files with 52 additions and 7 deletions

View file

@ -64,6 +64,13 @@ fi
# end DR 16362
# DR 16464
if [ -d /awips2/GFESuite/ServiceBackup/data/${CAPS_FAILED_SITE} ]; then
log_msg "Removing rsync_parms.site for site ${CAPS_FAILED_SITE}"
rm -f /awips2/GFESuite/ServiceBackup/data/rsync_parms.${CAPS_FAILED_SITE}
fi
# end DR 16464
#-- Remove the rsync grids
if [ "$CAPS_FAILED_SITE" = "aer" ]
then

View file

@ -47,6 +47,7 @@ log_msg Preparing configuration files for export...
edexDest=GFEconfig/edex_static
commonDest=GFEconfig/common_static
caveDest=GFEconfig/cave_static
rsyncParms=GFEConfig # DR 16464
log_msg 15
log_msg Making temporary edex configuration directories...
@ -61,6 +62,11 @@ log_msg Making temporary cave configuration directories
mkdir -p $caveDest/site
log_msg 30
# DR 16464
log_msg Making temporary rsync_parms directory
mkdir -p $rsyncParms/site
log_msg 35
# Copies the localization information to the staging area
log_msg Copying common site configuration for site ${CAPS_SITE} to temporary directory...
cp -r ${LOCALIZATION_PATH}/common_static/site/${CAPS_SITE}/gfe $commonDest/site
@ -88,6 +94,13 @@ log_msg Copying cave site colormaps configuration for site ${CAPS_SITE} to tempo
cp -r ${LOCALIZATION_PATH}/cave_static/site/${CAPS_SITE}/colormaps $caveDest/site
log_msg 80
# DR 16464
if [ -f /awips2/GFESuite/ServiceBackup/data/rsync_parms.${CAPS_SITE} ]; then
log_msg Copying the rsync_parms file for site ${CAPS_SITE} to temporary directory...
cp -a /awips2/GFESuite/ServiceBackup/data/rsync_parms.${CAPS_SITE} $rsyncParms/site
log_msg 83
fi
# Tar up everything.
log_msg 85
log_msg Tarring and zipping configuration to file GFEconfig.${SITE}.tar.gz

View file

@ -106,6 +106,7 @@ edex_site_dest=${LOCALIZATION_PATH}/edex_static/site/${SITE_CAPS}/config
edex_site_si_dest=${LOCALIZATION_PATH}/edex_static/site/${SITE_CAPS}
common_site_dest=${LOCALIZATION_PATH}/common_static/site/${SITE_CAPS}
cave_site_dest=${LOCALIZATION_PATH}/cave_static/site/${SITE_CAPS}
rsync_parms_dest=/awips2/GFESuite/ServiceBackup/data # DR 16464
if [ -d ${edex_site_dest} ]; then
log_msg "edex_static site directory exists for ${SITE_CAPS}"
@ -127,6 +128,14 @@ else
log_msg "Creating cave_static site directory for ${SITE_CAPS}"
mkdir -p ${cave_site_dest}
fi
# DR 16464
if [ -d ${rsync_parms_dest} ]; then
log_msg "rsync_parms_dest directory exists for ${SITE_CAPS}"
else
log_msg "Creating rsync_parms_dest directory for ${SITE_CAPS}"
mkdir -p ${rsync_parms_dest}
fi
log msg 59
log_msg "${SITE_CAPS}'s localization directories have been verified"
log_msg 60
@ -138,6 +147,9 @@ cp -r GFEconfig/edex_static/site/smartinit ${edex_site_si_dest}
log_msg 90
cp -r GFEconfig/cave_static/site/* ${cave_site_dest}
log_msg 93
# DR 16464
cp -a GFEConfig/site/rsync_parms.${SITE_CAPS} ${rsync_parms_dest}.${SITE_CAPS}
log_msg 94
log_msg "Files successfully copied!"
log_msg "Changing ownership of received configuration"
@ -146,6 +158,7 @@ then
chown -R awips:fxalpha ${LOCALIZATION_PATH}/edex_static/site/${SITE_CAPS}
chown -R awips:fxalpha ${LOCALIZATION_PATH}/common_static/site/${SITE_CAPS}
chown -R awips:fxalpha ${LOCALIZATION_PATH}/cave_static/site/${SITE_CAPS}
chown -R awips:fxalpha /awips2/GFESuite/ServiceBackup/data # DR 16464
elif [ $USER = "awips" ]
then
log_msg "Files already owned by awips"

View file

@ -8,7 +8,7 @@
# Authors: Virgil Middendorf (BYZ), Steve Sigler (MSO) #
# Contributers: Ahmad Garabi, Ken Sargeant, Dave Pike, Dave Rosenberg, #
# Tim Barker, Maureen Ballard, Jay Smith, Dave Tomalak, #
# Evelyn Bersack, Juliya Dynina, Jianning Zeng #
# Evelyn Bersack, Juliya Dynina, Jianning Zeng, John McPherson #
# #
# Date of last revision: 04/22/13 #
# #
@ -142,7 +142,10 @@
# the hard-coded path to /awips2/fxa/bin with $FXA_BIN. Removed #
# awips1 code. #
# 11/02/12: Restored error checking for AWIPS2. #
# 04/22/13: Update the permission of the log directories. #
# 04/22/13: Update the permission of the log directories. #
# 02/24/14: Create the file if rsync_parms.${site} is not available, #
# and mkdir the site directory on the local rsync server if it #
# does not exist. #
################################################################################
# check to see if site id was passed as argument
# if not then exit from the script
@ -161,14 +164,18 @@ fi
################################################################################
IFPS_DATA="/awips2/GFESuite/ServiceBackup/data"
IFPS_CREATE_FILE="/awips2/GFESuite/bin"
if [ ! -f ${IFPS_DATA}/rsync_parms.${site} ] ;then
echo "${IFPS_DATA}/rsync_parms.${site} does not exist!"
echo "Please contact your ITO to create this file from /awips2/GFESuite/bin/rsync_parms.ccc"
exit
else
. ${IFPS_DATA}/rsync_parms.${site}
cp ${IFPS_CREATE_FILE}/rsync_parms.ccc ${IFPS_DATA}/rsync_parms.${site}
# Added above line for DR 16464, just create file if it does not exist, do not error off
# echo "${IFPS_DATA}/rsync_parms.${site} does not exist!"
# echo "Please contact your ITO to create this file from /awips2/GFESuite/bin/rsync_parms.ccc"
# exit
fi
# else
. ${IFPS_DATA}/rsync_parms.${site}
# fi
################################################################################
@ -325,6 +332,11 @@ echo "space used in netcdf: $(cd ${WRKDIR}; du -m --max-depth=1) mb" >> $LOG_FI
echo ... finished >> $LOG_FILE
echo " " >> $LOG_FILE
# if directory to write to is not on local rysnc server, create it. DR 16464
if [ ! ssh ${locServer} 'ls "${locDirectory}" >/dev/null' ] ;then
ssh ${locServer} mkdir ${locDirectory}
fi
# Clean up orphaned files on the local rsync server.
echo cleaning up orphaned files on $locServer in the ${locDirectory}/${site} directory at $(date) >> $LOG_FILE
ssh $locServer "find ${locDirectory}/${site} -mmin +720 -exec rm {} -f \;"