Changeset 10041 for trunk/Mars/datacenter/scripts/sourcefile
- Timestamp:
- 10/27/10 17:48:15 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Mars/datacenter/scripts/sourcefile
r10007 r10041 48 48 export SOURCEFILEPATH=`dirname $0` 49 49 fi 50 51 # possible solution for $0 problem:52 # ${BASH_SOURCE[0]} 53 # but has to be checked and tested more carefully 54 # should solve at least problem with login-shell and with source 50 if [ "$SCRIPTNAME" = "" ] 51 then 52 SCRIPTNAME=`basename $0` 53 fi 54 55 55 source $SOURCEFILEPATH/setup.$AUTOMATIONSETUP 56 56 … … 68 68 if ! [ "$processlog" = "" ] 69 69 then 70 echo `date +%F\ %T`" "`whoami`"@"$HOSTNAME" " `basename $0`"["$$"] ERROR could not make dir "$@ >> $processlog70 echo `date +%F\ %T`" "`whoami`"@"$HOSTNAME" "$SCRIPTNAME"["$$"] ERROR could not make dir "$@ >> $processlog 71 71 else 72 72 echo "could not make dir "$@ … … 95 95 { 96 96 makedir $processlogpath 97 echo `date +%F\ %T`" "`whoami`"@"$HOSTNAME" " `basename $0`"["$$"] "$@ >> $processlog97 echo `date +%F\ %T`" "`whoami`"@"$HOSTNAME" "$SCRIPTNAME"["$$"] "$@ >> $processlog 98 98 } 99 99 … … 105 105 printprocesslog "DEBUG " `rm -v $lockfile` 106 106 fi 107 printprocesslog "DEBUG finished $0"107 printprocesslog "DEBUG finished "$SOURCEFILEPATH"/"$SCRIPTNAME 108 108 exit 109 109 } … … 153 153 function checklock() 154 154 { 155 if ! echo `date +%F\ %T`" "`whoami`"@"$HOSTNAME" " `basename $0`"["$$"] "`uname -a` > $lockfile 2>/dev/null155 if ! echo `date +%F\ %T`" "`whoami`"@"$HOSTNAME" "$SCRIPTNAME"["$$"] "`uname -a` > $lockfile 2>/dev/null 156 156 then 157 157 printprocesslog "WARN lockfile $lockfile exists" … … 424 424 do 425 425 query=$query" AND "$step"Status."`echo ${prims[$j]} | sed -e 's/,//g'`"='${primaries[$s*${#prims[@]}+$j]}' " 426 done 426 done 427 # add additional query to allow for locking in db 428 if [ "$1" = "start" ] 429 then 430 query=$query" AND ISNULL("$step"Status.fStartTime) " 431 fi 432 # add row count to know how many rows have been changed 433 query=$query"; SELECT ROW_COUNT();" 427 434 # print query 428 435 printprocesslog "DEBUG setstatus for step $step QUERY: "$query 429 436 # execute query 430 if ! mysql -s -u $us --password=$pw --host=$ho $db -e " $query "437 if ! numchanged=`mysql -s -u $us --password=$pw --host=$ho $db -e " $query "` 431 438 then 432 439 printprocesslog "ERROR could not set status in db (program: $program, function setstatus)" 433 440 finish 441 fi 442 if [ $numchanged -gt 0 ] 443 then 444 printprocesslog "INFO successful setting of status in db (program: $program, function setstatus)" 445 else 446 printprocesslog "INFO status in db was already set by other process (program: $program, function setstatus)" 434 447 fi 435 448 }
Note:
See TracChangeset
for help on using the changeset viewer.