Revision a2245bc3ea1ed19580160ac005a7bd9bc50c1075 authored by Max Hantke on 28 October 2014, 12:59:57 UTC, committed by Max Hantke on 28 October 2014, 12:59:57 UTC
run_cheetah_dark
#!/bin/bash
if [ $# -eq 0 ];
then
echo "USAGE: dark_cheetah rXXXX [rYYYY, rZZZZ, ...]"
echo "The following enviromnmental variables need to be defined: XTCDIR, CONFDIR_DARK and H5DIR_DARK"
else
cd $H5DIR_DARK
for (( i=1; i<=$#; i++ )); do
eval RUN=\$$i
echo "Processing $RUN"
eval RUNDIR=$RUN"_"$(date -d "today" +"%Y%m%d_%H%M")
echo "Creating directory: "$RUNDIR
mkdir $RUNDIR
if [ -f $CONFDIR_DARK/cheetah_$RUN.ini ];
then
cp $CONFDIR_DARK/cheetah_$RUN.ini $RUNDIR/cheetah.ini
else
cp $CONFDIR_DARK/cheetah.ini $RUNDIR/
fi
if [ -f $CONFDIR_DARK/psana_$RUN.cfg ];
then
cp $CONFDIR_DARK/psana_$RUN.cfg $RUNDIR/psana.cfg
else
cp $CONFDIR_DARK/psana.cfg $RUNDIR/
fi
echo "#!/bin/bash\n" > $RUNDIR/process.sh
echo "psana -c psana.cfg $XTCDIR/*$RUN*.xtc" > $RUNDIR/process.sh
chmod u+x $RUNDIR/process.sh
cd $RUNDIR
./process.sh
cd ..
echo "Setting link from $RUN to directory $RUNDIR"
rm $RUN
ln -s $RUNDIR $RUN
echo "Exit from processing $RUN"
done
fi
Computing file changes ...