Commit 2656ada6 authored by Matteo Quintiliani's avatar Matteo Quintiliani

Ok


git-svn-id: file:///home/quintiliani/svncopy/nmxptool/trunk@677 3cd66e75-5955-46cb-a940-c26e5fc5497d
parent d7ea4712
......@@ -32,8 +32,9 @@ fi
YEAR=$1
NET=$2
STA=$3
CHAN=$4.D
CHAN=$4
JDAY=$5
JDAY=`echo $5 | sed -e "s/^[0]*//"`
if [ $JDAY -le 0 ]; then
export TODAY=$(date "+%j" | sed -e "s/^[0]*//")
......@@ -59,10 +60,10 @@ fi
JDAY=$(printf %03d $JDAY)
#pseudo static variables
NMXPTOOL=nmxptool
NMXPBINDIR=/home/sysop/seiscomp/acquisition/bin
NMXPTOOL=${NMXPBINDIR}/nmxptool
NMXPHOST=naqs2a.int.ingv.it
DIRARCHIVESDS=/home/sysop/seiscomp/acquisition/archive
DIRARCHIVESDS2=/mnt/seedstore/archive
DIRARCHIVESDS=/mnt/seedstore/nmxp_accel
# derivated variables
DIRLOG=$(dirname $0)/log
......@@ -70,8 +71,25 @@ NOW=$(date "+%Y%m%dx%H%M%S")
FILELOG=$DIRLOG/nmdc.$1.$2.$3.$4.$5.$NOW.log
FILEMAILDAY=$DIRLOG/mail
echo $NMXPTOOL -H $NMXPHOST -C ${STA}.${CHAN} -m
FILEARCH=${DIRARCHIVESDS}/${YEAR}/${NET}/${STA}/${CHAN}/${NET}.${STA}.${LOC}.${CHAN}.${YEAR}.${JDAY}
echo ${FILEARCH}
FILEARCH=${DIRARCHIVESDS}/${YEAR}/${NET}/${STA}/${CHAN}.D/${NET}.${STA}.${LOC}.${CHAN}.D.${YEAR}.${JDAY}
if [ -f ${FILEARCH} ]; then
echo "WARNING: ${FILEARCH} already exists! It will not be override!"
else
$NMXPTOOL -H $NMXPHOST -m -C ${NET}.${STA}.${CHAN} -s ${YEAR}.${JDAY},00:00:00.0000 -e ${YEAR}.${JDAY},23:59:59.9999
NMXPFILEARCH=${NET}.${STA}.${CHAN}_${YEAR}.${JDAY}.00.00.00.0000_${YEAR}.${JDAY}.23.59.59.9999.miniseed
if [ -f $NMXPFILEARCH ]; then
FILENMXPARCHSIZE=`stat -c %s ${NMXPFILEARCH}`
if [ $FILENMXPARCHSIZE -le 0 ]; then
echo "WARNING: ${NMXPFILEARCH} is empty! It will not be saved!"
rm -f $NMXPFILEARCH
else
echo "Moving ${NMXPFILEARCH} to ${FILEARCH} ... "
mkdir -p `dirname ${FILEARCH}`
mv ${NMXPFILEARCH} ${FILEARCH}
fi
else
echo "ERROR: ${NMXPFILEARCH} has not been created by nmxptool."
fi
fi
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment