Skip to content

Commit

Permalink
Create condor_check.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesletts committed Apr 28, 2014
1 parent 38685cc commit 8357eab
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions condor_check.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
#!/bin/sh

# put a time limit on a command
alarm() { perl -e 'alarm shift; exec @ARGV' "$@"; }

# location of the output file
OUTLOCATION=/crabprod/CSstoragePath/Monitor
OUTFILE=$OUTLOCATION/monitor-anaops-`/bin/date +%F-Z%R -u`.txt


cat >> $OUTFILE <<EOF
======================================================= ANAOPS POOL =======================================================
EOF
# run analysis of analysis ops pool, with a time limit of 300s.
alarm 300 /home/letts/scripts/condor_check glidein-collector-2.t2.ucsd.edu >> $OUTFILE
rc=$?



cat >> $OUTFILE <<EOF
======================================================= GLOBAL POOL =======================================================
EOF
# run analysis of global pool, with a time limit of 300s.
alarm 300 /home/letts/scripts/condor_check vocms097.cern.ch short >> $OUTFILE

cat >> $OUTFILE <<EOF
===================================================== PRODUCTION POOL =====================================================
EOF
alarm 300 /home/letts/scripts/condor_check vocms97.cern.ch short >> $OUTFILE


# if everything ran correctly, then update the latest file:
if [ $rc -eq 0 ] ; then
LINKNAME=$OUTLOCATION/latest.txt
rm $LINKNAME
ln -s $OUTFILE $LINKNAME
fi

exit 0

0 comments on commit 8357eab

Please sign in to comment.