File indexing completed on 2026-04-25 08:29:08
0001
0002
0003 MIN_ARG_COUNT=2
0004 MAX_ARG_COUNT=3
0005 if [ "$#" -lt "$MIN_ARG_COUNT" ] || [ "$#" -gt "$MAX_ARG_COUNT" ] ; then
0006 echo "Unsupported call:"
0007 echo $0 $@
0008 echo Abort.
0009 exit 0
0010 fi
0011
0012 filename=${1}
0013 destination=${2}
0014 dbid=${3:--1}
0015 if [ $dbid -eq -1 ] || [ $dbid -eq 0 ]; then
0016
0017
0018 dbid=${PRODDB_DBID:--1}
0019 fi
0020
0021 if [ ! -f ${filename} ]; then
0022 echo "${filename} not found!"
0023 echo ls -lahtr
0024 ls -lahtr
0025 exit 0
0026 fi
0027
0028
0029
0030
0031
0032 rm -f numbers.txt cleannumbers.txt
0033 root.exe -l -b -q GetEntriesAndEventNr.C\(\"${filename}\"\) > numbers.txt
0034 tail -n 3 numbers.txt | awk '{print $NF}' > cleannumbers.txt
0035
0036 nevents=`sed -n '1p' cleannumbers.txt`
0037 first=`sed -n '2p' cleannumbers.txt`
0038 last=`sed -n '3p' cleannumbers.txt`
0039
0040
0041 nevents=${nevents:--1}
0042 first=${first:--1}
0043 last=${last:--1}
0044
0045 echo cat numbers.txt
0046 cat numbers.txt
0047 echo cat cleannumbers.txt
0048 cat cleannumbers.txt
0049 rm -f numbers.txt cleannumbers.txt
0050
0051
0052 md5=`/usr/bin/env md5sum ${filename} | cut -d ' ' -f 1`
0053
0054
0055
0056 size=`stat -c '%s' ${filename}`
0057 ctime=`stat -c '%Y' ${filename}`
0058
0059
0060 destname=`basename ${filename}`
0061 destname="${destname}:nevents:${nevents}"
0062 destname="${destname}:first:${first}"
0063 destname="${destname}:last:${last}"
0064 destname="${destname}:md5:${md5}"
0065 destname="${destname}:size:${size}"
0066 destname="${destname}:ctime:${ctime}"
0067 destname="${destname}:dbid:${dbid}"
0068
0069 action="dd if=${filename} of=${destination}/${destname} bs=12MB && rm -v ${filename}"
0070
0071 echo ${action}
0072 echo
0073 eval ${action}
0074
0075 exit 0