-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #93 from EdwardSafford-NOAA/feature/fix-xfer-92
Update RadMon transfer scripts to work on hera. Closes #92
- Loading branch information
Showing
5 changed files
with
44 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,35 @@ | ||
#!/bin/bash | ||
|
||
if [[ ${IMGNDIR} != "/" ]]; then | ||
if [[ ${TANKimg} != "/" && -d ${TANKimg} ]]; then | ||
|
||
WEBSVR=${WEBSVR}.ncep.noaa.gov | ||
|
||
#---------------------------------------------------------- | ||
# If the destination directory exists (on the server) then | ||
# sync the html there with the $TANKimg directory so we | ||
# have a backup copy. Note the pngs subdirectory is | ||
# skipped -- we only want to update the html and related | ||
# site files in $TANKimg, not the files in /pngs. Also | ||
# note that the use of the --update option means that if a | ||
# file exists in both places the destination file is not | ||
# updated if it's newer. | ||
# | ||
# Else create the destintation directory on the server. | ||
#---------------------------------------------------------- | ||
|
||
if ssh ${WEBUSER}@${WEBSVR} "[ -d ${WEBDIR} ]"; then | ||
/usr/bin/rsync -ave ssh --exclude 'pngs/' --update \ | ||
${WEBUSER}@${WEBSVR}:${WEBDIR}/ ${TANKimg} | ||
else | ||
ssh ${WEBUSER}@${WEBSVR} "mkdir -p ${WEBDIR}" | ||
fi | ||
|
||
/usr/bin/rsync -ave ssh --exclude *.ctl.${Z} \ | ||
--exclude 'horiz' --exclude *.png --delete-during ${IMGNDIR}/ \ | ||
${WEBUSER}@${WEBSVR}.ncep.noaa.gov:${WEBDIR}/ | ||
--exclude 'horiz' --exclude *.png --delete-during --update ${TANKimg}/ \ | ||
${WEBUSER}@${WEBSVR}:${WEBDIR}/ | ||
|
||
else | ||
echo "Unable to run rsync, TANKimg has bad/no value of: ${TANKimg}" | ||
fi | ||
|
||
exit |