#!/usr/bin/env bash #----------------------------------------------------------------------- # runs in /cdf/scratch/cdfopr/val # checks catalog of the stream A stntuples and catalogs those # files which have been ntupled but are not listed in the # "last fileset" of the catalog #----------------------------------------------------------------------- VERBOSE=0 ; if [ .$1 != "." ]; then VERBOSE=$1 ; fi dir=/cdf/opr2/cdfopr/val/results list=`cat $STNTUPLE_CATALOG/stntuple/sewk00/sewk00.files | \ grep -v "^#" | grep sewk00.last | awk '{print $2}'` # list="aa02bc72.0296phys.s aa02bc72.0313phys.s " if [ $VERBOSE != 0 ] ; then echo $list ; fi export TO_BE_CATALOGED="" for f in `ls $dir` ; do # echo $f ; cataloged=.`echo $list | grep $f` # echo cataloged=.$cataloged. if [ "$cataloged" == "." ] ; then # # not cataloged file # # echo $f is not in the catalog yet export TO_BE_CATALOGED=$TO_BE_CATALOGED" "$dir/$f fi done # echo TO_BE_CATALOGED=$TO_BE_CATALOGED #----------------------------------------------------------------------- # submit cataloging job #----------------------------------------------------------------------- root.exe -b -l < .catalog.log .L Stntuple/ana/dfc_ana.C catalog_list_of_files() EOF #----------------------------------------------------------------------- # parse the result #----------------------------------------------------------------------- new_list=`cat .catalog.log | grep aa | grep -v OBJ | \ awk '{ print "sewk00.last "$0"\n"}'` echo $new_list #----------------------------------------------------------------------- # so far manual intervention is required - need to fix! #-----------------------------------------------------------------------