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/checkfilesforsequenceavail

    r7426 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 sequences.
     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 sequence the availability of the files (raw, cc, caco) is
     33# checked by using the macro checkfilesavail.C
     34# If this was successful, the status is inserted into the database using
     35# the macro setstatus.C
    2736#
    2837
     
    5160cd $mars
    5261
    53 if [ -e $todofile ]
    54 then
    55    echo "checkfilesforsequenceavail is already running -> exit" >> $scriptlog 2>&1
    56    exit
    57 fi
     62# check if script is already running
     63date > $lockpath/lock-checkfileavail.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 "-> checkfileavail 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
    5873
     74# get todo list
    5975echo "getting list..." >> $scriptlog 2>&1
    6076check0=`root -q -b $macrospath/getdolist.C+\("\"$table\""\,"\"$column\""\,"\"$date\""\,"\"$listpath\""\) | tee $getstatuslog | grep int | sed -e 's/(int)//'`
     
    6278case $check0 in
    6379   1)   echo "check0=$check0 -> everything ok -> do step" >> $scriptlog 2>&1 ;;
    64    *)   echo "check0=$check0 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1 ;;
     80   *)   echo "check0=$check0 -> ERROR -> step has to be repeated" >> $scriptlog 2>&1
     81        rm -v $todofile >> $scriptlog 2>&1
     82        rm -v $lockpath/lock-checkfileavail.txt >> $scriptlog 2>&1
     83        date  >> $scriptlog 2>&1
     84        exit;;
    6585esac
    6686
     87# retrieve sequences from todofile
    6788sequences=(`cat $todofile`)
    68 
    6989if [ "$sequences" = "" ]
    7090then
    7191   echo "nothing to do -> exit"  >> $scriptlog 2>&1
    7292   rm -v $todofile >> $scriptlog 2>&1
    73    rm -v $lockpath/lock-$table-$column.txt >> $scriptlog 2>&1
     93   rm -v $lockpath/lock-checkfileavail.txt >> $scriptlog 2>&1
    7494   date  >> $scriptlog 2>&1
    7595   exit
     
    7797
    7898echo "sequences: "${sequences[@]} >> $scriptlog 2>&1
    79 
    8099for sequence in ${sequences[@]}
    81100do
     
    107126
    108127rm -v $todofile  >> $scriptlog 2>&1
    109 rm -v $lockpath/lock-$table-$column.txt >> $scriptlog 2>&1
     128rm -v $lockpath/lock-checkfileavail.txt >> $scriptlog 2>&1
    110129
    111130date  >> $scriptlog 2>&1
Note: See TracChangeset for help on using the changeset viewer.