Ignore:
Timestamp:
01/10/06 22:12:58 (19 years ago)
Author:
Daniela Dorner
Message:
*** empty log message ***
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/datacenter/scripts/checkstardone

    r7265 r7460  
    2020#   Author(s): Daniela Dorner  08/2004 <mailto:dorner@astro.uni-wuerzburg.de>
    2121#
    22 #   Copyright: MAGIC Software Development, 2000-2004
     22#   Copyright: MAGIC Software Development, 2000-2006
    2323#
    2424#
    2525# ========================================================================
    2626#
     27# This script launches the checking of the availability of the files for
     28# the datasets.
     29#
     30# After checking, if the script is already running, the todolist is
     31# written by using the macro getdolist.C
     32# Then for each dataset the sequences are extracted from the datasetfile
     33# and for each sequence the availability of the star files checked by using
     34# the macro checkstardone.C
     35# If this was successful, the status is inserted into the database using
     36# the macro setstatus.C
    2737#
    2838
     
    4252scriptlogpath=$logpath/run/checkstardone/`date +%Y/%m/%d`
    4353makedir $scriptlogpath
    44 
    4554scriptlog=$scriptlogpath/checkstardone-$datetime.log
    4655
     
    5160cd $mars
    5261
     62# check if script is already running
     63date > $lockpath/lock-checkstardone.txt >> $scriptlog 2>&1
     64checklock0=$?
     65case $checklock0 in
     66    0)   echo "checklock0=$checklock0 -> continue " >> $scriptlog 2>&1;;
     67    1)   echo "checklock0=$checklock0 -> file exists " >> $scriptlog 2>&1
     68         echo "-> checkstardone is running -> exit" >> $scriptlog 2>&1
     69         date  >> $scriptlog 2>&1
     70         exit;;
     71    *)   echo "checklock0=$checklock0 -> something went completely wrong" >> $scriptlog 2>&1;;
     72esac
    5373
    54 if [ -e $todofile ]
    55 then
    56    echo "checkstardone is already running -> exit" >> $scriptlog 2>&1
    57    exit
    58 fi
    59 
     74# get todo list
    6075echo "getting list..." >> $scriptlog 2>&1
    6176check0=`root -q -b $macrospath/getdolist.C+\("\"$table\""\,"\"$column\""\,"\"$date\""\,"\"$listpath\""\) | tee $getstatuslog | grep int | sed -e 's/(int)//'`
     
    6378case $check0 in
    6479   1)   echo "check0=$check0 -> everything ok -> do step" >> $scriptlog 2>&1 ;;
    65    *)   echo "check0=$check0 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1 ;;
     80   *)   echo "check0=$check0 -> ERROR -> could not get list -> exit" >> $scriptlog 2>&1
     81        rm -v $todofile >> $scriptlog 2>&1
     82        rm -v $lockpath/lock-checkstardone.txt >> $scriptlog 2>&1
     83        date  >> $scriptlog 2>&1
     84        exit;;
    6685esac
    6786
    6887datasets=(`cat $todofile`)
    69 
    7088if [ "$datasets" = "" ]
    7189then
    7290   echo "nothing to do -> exit"  >> $scriptlog 2>&1
    7391   rm -v $todofile >> $scriptlog 2>&1
    74    rm -v $lockpath/lock-$table-$column.txt >> $scriptlog 2>&1
     92   rm -v $lockpath/lock-checkstardone.txt >> $scriptlog 2>&1
    7593   date  >> $scriptlog 2>&1
    7694   exit
     
    7896
    7997echo "datasets: "${datasets[@]} #>> $scriptlog 2>&1
    80 
    8198for dataset in ${datasets[@]}
    8299do
     
    123140
    124141rm -v $todofile  >> $scriptlog 2>&1
    125 rm -v $lockpath/lock-$table-$column.txt >> $scriptlog 2>&1
     142rm -v $lockpath/lock-checkstardone.txt >> $scriptlog 2>&1
    126143
    127144date  >> $scriptlog 2>&1
Note: See TracChangeset for help on using the changeset viewer.