Changeset 9122 for trunk/MagicSoft/Mars/datacenter/scripts/scriptlauncher
- Timestamp:
- 08/15/08 13:49:05 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/datacenter/scripts/scriptlauncher
r8482 r9122 31 31 printprocesslog "INFO starting $0 $@" 32 32 33 makedir $listpath34 makedir $lockpath35 36 33 errorlog=$runlogpath/scriptlauncher-error`date +%F`.log 37 34 scriptlog=$runlogpath/scriptlauncher`date +%F`.log … … 42 39 date=`date +%Y-%m-%d` 43 40 44 scripts=( `echo $@ | sed -e 's/allatthesametime//'` ) 45 num=${#scripts[@]} 46 echo "$num scripts have to be launched" >> $scriptlog 2>&1 47 i=0 41 num=$# 42 echo "$num scripts have to be launched" #>> $scriptlog 2>&1 43 i=1 48 44 49 while [ $i -lt $num ] 45 if echo $@ | grep "allatthesametime" >/dev/null 2>$errorlog 46 then 47 all="yes" 48 else 49 all="no" 50 fi 51 52 while [ $i -le $num ] 50 53 do 51 echo " launching ${scripts[$i]}..." >> $scriptlog 2>&1 52 pid=`/usr/local/bin/condor_submit -a path=$path -a prog=${scripts[$i]} -a date=$date -a dir=$runlogpath $path/run.condor 2>> $errorlog | grep 'submitted to cluster' | cut -dr -f2` 54 com=( ) 55 prog= 56 if [ "$1" = "allatthesametime" ] 57 then 58 shift 59 i=`expr $i + 1` 60 continue 61 fi 62 com=( $1 ) 63 prog=${com[0]} 64 if ! ls $path/${com[0]} >/dev/null 2>&1 65 then 66 echo "script $path/$1 does not exist." >> $scriptlog 2>&1 67 shift 68 i=`expr $i + 1` 69 continue 70 fi 71 if [ `echo $1 | wc -w` -gt 1 ] 72 then 73 unset com[0] 74 args='-a args="'${com[@]}'"' 75 fi 76 echo " launching $1..." >> $scriptlog 2>&1 77 echo "/usr/local/bin/condor_submit -a path=$path -a prog=$prog $args -a date=$date -a dir=$runlogpath $path/run.condor 2>> $errorlog | grep 'submitted to cluster' | cut -dr -f2" >> $scriptlog 2>&1 78 pid=`/usr/local/bin/condor_submit -a path=$path -a prog=$prog $args -a date=$date -a dir=$runlogpath $path/run.condor 2>> $errorlog | grep 'submitted to cluster' | cut -dr -f2` 53 79 if [ "$pid" = "" ] 54 80 then 55 81 echo `date`" WARN condor is not working " >> $errorlog 2>&1 56 printprocesslog "WARN submitting ${scripts[$i]} to condor failed" 82 printprocesslog "WARN submitting $1 to condor failed" 83 shift 84 i=`expr $i + 1` 57 85 continue 58 86 fi 59 if ! echo $@ | grep "allatthesametime" >/dev/null 2>$errorlog87 if [ "$all" = "no" ] 60 88 then 61 echo " waiting for $ {scripts[$i]}to be done..." >> $scriptlog 2>&189 echo " waiting for $1 to be done..." >> $scriptlog 2>&1 62 90 /usr/local/bin/condor_wait $runlogpath/condor-$date.log $pid >/dev/null 2>$errorlog 63 91 fi 92 shift 64 93 i=`expr $i + 1` 65 94 done
Note:
See TracChangeset
for help on using the changeset viewer.