$SMSBIN/smsinit $LOADL_STEP_ID echo " Running on `hostname` -- `date`" set -xa # # obtain unique process id (pid) and make temp directory # export PS4='$SECONDS + ' export pid=$$ export DATA=/tmpnwprd/${job}.${pid} mkdir $DATA cd $DATA export cycle=t${cyc}z #################################### # File To Log Msgs #################################### export jlogfile=/com/logs/jlogfile #################################### # Determine Job Output Name on System #################################### export outid="LL$job" export jobid="${outid}.o${pid}" export pgmout="OUTPUT.${pid}" export MP_PULSE=0 export SENDCOM=NO export SENDDBN=YES export SENDSMS=YES ################################### # Set up the UTILITIES ################################### export utilscript=/nwprod/util/ush export utilexec=/nwprod/util/exec export utilfix=/nwprod/util/fix # Run setup to initialize working directory and utility scripts sh $utilscript/setup.sh export PDY=20121101 msg="HAS BEGUN on `hostname`" postmsg "$jlogfile" "$msg" # Run setpdy and initialize PDY variables sh $utilscript/setpdy.sh . PDY date sorf=`hostname | cut -c1` if [ "$sorf" = "s" ] ; then hostlist=${utilfix}/interactive.hosts.cirrus else hostlist=${utilfix}/interactive.hosts.stratus fi # # Create a new list of hosts to submit to, placing the previous host # used at the end of the list # lasthost=`cat /com/logs/rdist.lasthost` numhosts=`cat $hostlist | wc -l` lastnum=`grep -n $lasthost $hostlist | awk -F: '{print $1}'` let newnum=numhosts-lastnum tail -$newnum $hostlist > newlist head -$lastnum $hostlist >> newlist for mach in `cat newlist` do ping -c1 $mach pingerr=$? if [ $pingerr -eq 0 ] ; then host=$mach echo $host > /com/logs/rdist.lasthost break fi done if [ $pingerr -ne 0 ] ; then err_exit "NO AVAILABLE MACHINES TO TRANSFER FILES TO" fi cat << EOF > ./distlist HOSTS = ( $host ) FILES = ( /nwprod/ ) nwprod: \${FILES} -> \${HOSTS} except_pat ( /.svn ) ; # except_pat ( tcp9 ) ; # commented out since no recent reference to tcp9 found on CCS. kept for reference install; EOF timex /usr/sbin/rdist -R -P /nwprod/scripts/nwprod.ossh -f ./distlist #------------------------------ errdist=$? if [ $errdist -ne 0 ] then echo "$errdist : $jobid `date`" >> /com/logs/test/rdist_log fi #-------------------------------- # err=$?;export err; err_chk msg="JOB $job HAS COMPLETED NORMALLY." postmsg "$jlogfile" "$msg" date cd /tmpnwprd rm -rf $DATA $SMSBIN/smscomplete