File indexing completed on 2024-04-06 12:31:45
0001
0002
0003 currTime=`date '+%Y.%m.%d-%H.%M.%S'`
0004 outLockFile=${XXOUT_FNAME}.lock
0005
0006 echo ${PATH}
0007
0008 which cmsRun >& /dev/null
0009 [ "$?" != "0" ] && echo "No cmsRun in path" && exit 1
0010
0011 if [ "${XXIN_FNAME}" == "" -o "${XXOUT_FNAME}" == "" ]; then
0012 echo "XXIN_FNAME or XXOUT_FNAME are not set"
0013 echo "Set both and try again"
0014 exit 1
0015 fi
0016
0017 if [ ! -f "${XXIN_FNAME}" ]; then
0018 echo "No input file specified or file is nonexistent"
0019 echo "Check the file location and do export XXIN_NAME"
0020 exit 1
0021 fi
0022
0023
0024 if [ -f "${outLockFile}" ]; then
0025 echo "Output file is locked by another process"
0026 echo "Change the output file destination and restart"
0027 exit 1
0028 fi
0029
0030 if [ -f "${XXOUT_FNAME}" ]; then
0031 if [ "$1" == "skip" ]; then
0032 echo "Output file exists. Skip this input"
0033 exit 1
0034 else
0035 oldOutFName=${XXOUT_FNAME}_oldAt-${currTime}
0036 echo "Output file exists and will be moved to" ${oldOutFName}
0037 mv ${XXOUT_FNAME} ${oldOutFName}
0038 fi
0039 fi
0040
0041 touch ${outLockFile}
0042
0043 sedInFile=`echo ${XXIN_FNAME} | sed -e 's/\//\\\\\//g'`
0044 sedOutFile=`echo ${XXOUT_FNAME} | sed -e 's/\//\\\\\//g'`
0045
0046 outLogFile=${XXOUT_FNAME}.log
0047 outCfgFile=${XXOUT_FNAME}.cfg
0048
0049 cat testPropagatorAnalyzer.cfg |\
0050 sed -e "s/XXIN_FNAME/${sedInFile}/g;s/XXOUT_FNAME/${sedOutFile}/g;s/\\\\\//\//g"\
0051 > ${outCfgFile}
0052
0053 echo start cmsRun ${outCfgFile} at ${currTime} >& ${outLogFile}
0054 cmsRun ${outCfgFile} >& ${outLogFile}
0055
0056 rm ${outLockFile}
0057
0058 exit $?
0059