#!/bin/ksh ############################################################################# ## APPX_SUBMIT ## ## This script will submit the Appx background job specified on the ## the command line to the UniQue Batch Queue. ## ## usubmit must in in the user's PATH or this script must be modified ## to include the full pathname for usubmit ## ## The format of the command which executes this script is expected to be: ## ## appx_submit ## ## Where will be a list of the following options ## ## -image= ## -session= ## -mode= ## -notify= ## -date= ## -priority= ## -queue= ## -user= ## ############################################################################# function PROCESS_ARGS # arg ... { while test "$1" do case $1 in -image*) # -image= # # This argument contains the full pathname # of the Appx executable used to submit the # the background process COMMAND="${1#*=}" ;; -session*) # -session= # # This argument must be given to the Appx background # process when it is invoked. It is the eight- # character name of a file which contains all of # the context information necessary to restart the # submitted process COMMAND="$COMMAND $1" ;; -mode*) # -mode= # # This argument contains the value of the # "SUBMIT MODE" PDF. # # The -mode option (if non-blank) is used to # specify the job's mode. if test ${1#*=} then SUBMIT_MODE="${1#*=}" fi ;; -priority*) # -priority= # # This argument contains the value of the # "SUBMIT PRIORITY" PDF. # # The -priority option (if non-blank) is used to # specify the "nice" value of the background process. # It should be a value suitable for the Unix "nice" # command. if test ${1#*=} then SUBMIT_PRIORITY="${1#*=}" fi ;; -notify*) # -notify="Yes"|"No"|"" # # This argument is an interpretation of the # "SUBMIT NOTIFY USER" PDF. It will contain # either "Yes", "No", or blank. # if test ${1#*=} then SUBMIT_NOTIFY_USER="${1#*=}" fi ;; -date*) # -date=CCYYMMhhmmddhhssth # # This argument is an interpretation of the # "SUBMIT DATE" PDF. It will contain a date # in the indicated format or blank. # if test ${1#*=} then SUBMIT_DATE="${1#*=}" YY=`echo $SUBMIT_DATE | cut -c 3-4` MM=`echo $SUBMIT_DATE | cut -c 5-6` DD=`echo $SUBMIT_DATE | cut -c 7-8` HOUR=`echo $SUBMIT_DATE | cut -c 9-10` MIN=`echo $SUBMIT_DATE | cut -c 11-12` fi ;; -queue*) # -queue= # # This argument contains the value of the # "SUBMIT QUEUE" PDF. # if test ${1#*=} then SUBMIT_QUEUE="${1#*=}" fi ;; -user*) # -user= # # This argument contains the Unix user name # of the submitter. # if test ${1#*=} then UNIX_USER="${1#*=}" fi ;; esac shift done } # Initialize variables SUBMIT_MODE= SUBMIT_PRIORITY= SUBMIT_NOTIFY_USER= SUBMIT_DATE= SUBMIT_QUEUE= UNIX_USER= YY= MM= DD= HOUR= MIN= RUNDATE= RUNTIME= # Process command line arguments PROCESS_ARGS $* # Do not submit to queue if submit mode is KEEP if [ -n "$SUBMIT_MODE" ] then if [ "$SUBMIT_MODE" = "KEEP" ] then exit elif [ "$SUBMIT_MODE" = "HOLD" ] then SUBMIT_MODE=-Mhold else SUBMIT_MODE= fi fi # use the 1st position of SUBMIT QUEUE for class if [ -n "$SUBMIT_QUEUE" ] then SUBMIT_QUEUE=`echo $SUBMIT_QUEUE | cut -c 1` SUBMIT_QUEUE=-C$SUBMIT_QUEUE fi # get the date and time to run the job if [ -n "$SUBMIT_DATE" ] then RUNDATE="-d$MM/$DD/$YY" RUNTIME="-t$HOUR:$MIN" fi # submit the job to the UniQue Batch Queue /usr/spool/uprint/usubmit $SUBMIT_QUEUE $SUBMIT_MODE $RUNDATE $RUNTIME -q -c"$COMMAND < /dev/null > /dev/null 2>&1" # append the usubmit command to the log file echo "usubmit $SUBMIT_QUEUE $SUBMIT_MODE $RUNDATE $RUNTIME -q -c$COMMAND < /dev/null > /dev/null 2>&1" >> /tmp/submit.log ############################################################################# ## Modification History ## ## DATE BY Description ## -------- --- ---------------------------------------------------------- ## 10/31/93 KAD Initial Creation ## 09/22/95 SPF Added support for -mode option ## 09/22/95 SPF Revised to submit job to UniQue Batch Queue ## #############################################################################