#!/bin/bash # # Script to completely update the NAM 1-hourly forecast data # on tashtego OPeNDAP # # Run this daily (via cron) on queequeg. # All scripts and data files for auto operation use relative paths # with respect to the following directory: #ATH=/opt/compiled/nctools/bin:${PATH} PATH=/opt/compiled/gnu/opendap/bin:/opt/pgisoft/netcdf/bin:${PATH} export PATH #echo cd to directory: cd /home/wilkin/roms/svn/omlab/wilkin/Projects/espresso/nam/cron #pwd stamp=$(date +%Y%m%d):$(date +%H%M) if [ -n "$1" ] then archive=$1 else echo Error in $0 No archive option 1hour, 3hour ... given exit fi logfile=log.update_nam_$1_$stamp errfile=err.update_nam_$1_$stamp #echo $logfile # extract the recent files, including the full forecast for 12Z cycle ./step1_get_nam $archive > $logfile 2> $errfile # cat the daily files and rename to roms variables ./step2_cat_nam $archive >> $logfile 2>> $errfile # merge with existing file on thredds dataset scan catalog ./step3_merge_nam $archive >> $logfile 2>> $errfile echo "update_nam $archive completed for $stamp" | mail -s "update_nam $archive finished $stamp" wilkin@marine.rutgers.edu # restart tashtego opendap server # ssh wilkin@tashtego 'echo "umask 002; /opt/tomcat-instance/external_thredds_server/bin/restart.sh" | newgrp opendap_users'