US Argo Data Assembly Center
Documentation
Processing System

Scheduler for Execution Jobs Automatically

Scheduler - crontab file (crontab_list.current)

#!/bin/sh
# Revision Date: 22-Jan-00 (RS)
#
# Minutes after the hour, 0-59
# Hours of the day, 0-23 (0 = midnight)
# Day within a month, 1-31
# Month of the year, 1-12
# Day of the week, 0-6 (0 = Sunday)  System V (Solaris) or 1-7 (1=Monday) BSD
#
# ARGO jobs
# ---------
0   2 * * * /usr/bin/tcsh /l4/ARGO/argos/collect/scripts/allcollect
30 14 * * * /usr/bin/csh  /l4/ARGO/cron/scripts/cron_argo.csh all
0  15 * * * /usr/bin/csh  /l4/ARGO/cron/scripts/cron_argo.csh ftp2gts
30 15 * * * /usr/bin/csh  /l4/ARGO/cron/scripts/cron_argo.csh ftp2local
Startup Script - cron_argo.csh>
#!/bin/csh
# =====================================================================
# Revision Date: 29-Nov-00 (RS)
#
# cron_argo.csh
# =============
# Excutes ARGO subproccesses (argo.sh) according to CRONTAB scheduler.  
# Each process execution depends on the parameter passed to the script,
# by default it executes processes indicated with 'all'. 
# 
# Schedule to run in sequence or individually: 
#            argos_process.sh          (argos  or all)
#            qc_process.sh             (qc     or all)
#            phy2gts_format.sh         (gts    or all)
#            packqc_for_ftp.sh         (packqc or all)
#
# Schedule to run only individually:
#            ftpgts_to_gateway.sh      (ftp2gts)
#            ftpqcpack_to_publocal.sh  (ftp2local)
#            ftpqc_to_aoml.sh          (ftp2aoml - not implemented)
#
# Examples: 
#  1) all processes
#       unix> cron_argo.csh       (default)
#     or 
#       unix> cron_argo.csh all 
#  2) only gts 
#      unix> cron_argo.csh gts 
#  3) only ftp2gts 
#      unix> cron_argo.csh ftp2gts 
#
# =====================================================================
#
# *********************************************************************
#                 Global Variable Declarations
# *********************************************************************  
# Must source start-up run to bring ARGO global variables
# -------------------------------------------------------
source $HOME/.argorc
 
set CRON_DIR=$ARGO_DIR/cron                   # ARGO CRON directory
set CRON_SCRIPTS_DIR=$CRON_DIR/scripts        # ARGO CRON scripts
set CRON_LOGFILES_DIR=$CRON_DIR/log           # ARGO CRON log_files

# ARGO Process Initializtion 
# --------------------------
set INIT_SCRIPTS_DIR=$ARGO_DIR/init_scripts   # ARGO init scripts dir

# *********************************************************************
set HOST=`hostname`                           # host computer name
set prgname=`basename $0`

set script_name=argo.sh          
set nparm="$#argv"                            # Any parameter?                       

if ( $nparm == "0" ) then
  set mode=all
else
  set mode=$1
endif

set root_prgname=`echo $prgname | awk -F"." '{print $1}'`
set today=`date +'%Y.%m.%d_%H.%M'`
set logfile=$CRON_LOGFILES_DIR/$root_prgname.$today"_"stdout

set now=`date +'%h %d, %Y %T %p'`

echo "<================ Start $prgname at $now ==============>" >> $logfile
echo "     ENTER: $CRON_SCRIPTS_DIR/$prgname"                   >> $logfile
echo "     HOST:  $HOST"                                        >> $logfile
echo "     CRON LOGFILE(stdout): $logfile"                      >> $logfile 
echo "     MODE: $mode"                                         >> $logfile
echo "     RUN:    $INIT_SCRIPTS_DIR/$script_name $mode"        >> $logfile

$INIT_SCRIPTS_DIR/$script_name $mode                            >> $logfile 

echo "     FINISH: $INIT_SCRIPTS_DIR/$script_name $mode"        >> $logfile
set now=`date +'%h %d, %Y %T %p'`
echo "<=============== Finish $prgname at $now ==============>" >> $logfile

exit