/[MITgcm]/mitgcm.org/front_content/get+parse_msg
ViewVC logotype

Diff of /mitgcm.org/front_content/get+parse_msg

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.6 by jmc, Sat Feb 3 15:52:10 2018 UTC revision 1.7 by jmc, Thu Mar 15 20:38:28 2018 UTC
# Line 133  if test ! -e $OUTDIR ; then Line 133  if test ! -e $OUTDIR ; then
133      chmod 775 $OUTDIR      chmod 775 $OUTDIR
134      #-- In case a new-outpdir is made, process old files from "postponed"      #-- In case a new-outpdir is made, process old files from "postponed"
135      #   (if any old msg there) by changing INDIR to ../postponed      #   (if any old msg there) by changing INDIR to ../postponed
136      oldMsg=`ls -1 ${INDIR}/../postponed | wc -l`      if test $monthDir != 0 ; then
137          oldMsg=`ls -1 ${INDIR}/../postponed | wc -l`
138        fi
139      if test $oldMsg != 0 ; then      if test $oldMsg != 0 ; then
140        newInD=`dirname $INDIR`        newInD=`dirname $INDIR`
141        INDIR="$newInD/postponed"        INDIR="$newInD/postponed"
# Line 157  fi Line 159  fi
159  #---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|  #---+----1----+----2----+----3----+----4----+----5----+----6----+----7-|--+----|
160  if test $oldMsg = 0 ; then  if test $oldMsg = 0 ; then
161    
162  #- 1) check that $INDIR is empty  #- 1) check that $INDIR is empty (except .tar.gz files)
163    nbMsg=`ls -1 $INDIR | wc -l`    nbMsg=`ls -1 $INDIR | grep -v '\.tar\.gz$' | wc -l`
164    if test $nbMsg != 0 ; then    if test $nbMsg != 0 ; then
165      date      date
166      echo "ERROR: '$INDIR' is not empty ! --> exit"      echo "ERROR: '$INDIR' is not empty ! --> exit"
# Line 166  if test $oldMsg = 0 ; then Line 168  if test $oldMsg = 0 ; then
168    fi    fi
169    
170    nbMsg=0; ORIG=${RHOST}:$M_DIR    nbMsg=0; ORIG=${RHOST}:$M_DIR
171    #- 2) scp all msg from ORIG to INDIR  #- 2) scp all msg from ORIG to INDIR
172    cd $INDIR    cd $INDIR
173      scp -p ${RHOST}:$M_DIR/\* . > $STDOUT 2>&1      scp -p ${RHOST}:$M_DIR/msg.\* . > $STDOUT 2>&1
174      RETVAL=$?      RETVAL=$?
175      if test "x$RETVAL" != x0 ; then      if test "x$RETVAL" != x0 ; then
176       #echo " RETVAL='$RETVAL'"       #echo " RETVAL='$RETVAL'"
# Line 181  if test $oldMsg = 0 ; then Line 183  if test $oldMsg = 0 ; then
183         #rm -f $STDOUT         #rm -f $STDOUT
184          exit 6          exit 6
185      fi      fi
186      nbMsg=`ls -1 | wc -l`      listMsg='' ; nbMsg=`ls -1 msg.* 2>/dev/null | wc -l`
187      if test $nbMsg != 0 ; then      if test $nbMsg != 0 ; then
188          echo "> scp $nbMsg msg from '$ORIG' to '$INDIR'"          echo "> scp $nbMsg msg from '$ORIG' to '$INDIR'"
189          listMsg=`ls -1`          listMsg=`ls -1 msg.*`
190          #- And rename msg by adding unique suffix          #- And rename msg by adding unique suffix
191          for xx in $listMsg ; do          for xx in $listMsg ; do
192            mv $xx $xx.$sufx            mv $xx $xx.$sufx

Legend:
Removed from v.1.6  
changed lines
  Added in v.1.7

  ViewVC Help
Powered by ViewVC 1.1.22