#!/bin/bash

# ----------------------------------------------------------------------
# RPC Project :
# RPC_download_data_onemonth_CLUPOS : get POS data from CAA
#                           from CAA data base
#                           for one entire month and 4 S/C
#
# usage: RPC_download_data_onemonth_CLUPOS  year month Mode
# ex   : RPC_download_data_onemonth_CLUPOS  2009 03"
#
# P. Robert, LPP, 2012-08-25
#
# ----------------------------------------------------------------------


appli=`basename $0`
appli36=`echo "$appli                                 " | cut -c1-36`
Narg=2

if( (test $# = 1 ) && (test $1 = -h ) ) ; then hh=1 ; else hh=0 ; fi

if test $# != $Narg || test $hh = 1
   then
   echo "$appli : product CLUPOS.rff files 1 month 4 sat"
   echo "$appli   require $Narg argument(s), ex:"
   echo "$appli   year month "
   echo "    ex: $appli 2009 12"
   echo ""
   if test $hh = 1 ; then exit 0 ; fi
   echo "$appli36 : *** ERROR ! Command aborted." >&2
   exit 1
fi

datim1=`date +%F'  '%H':'%M':'%S `
julsec1=`date +%s`

year=$1
month=$2

# Run classical command but redirect  stdout and log file

log_onemonth=download_data_onemonth_CLUPOS"_"$year"_"$month.log

RPC_download_data_onemonth_CLUPOS_nolog $*  | tee -a $log_onemonth

# ----------------------------------------------------------------------
