Skip to content

Instantly share code, notes, and snippets.

@jnhutchinson
Created June 15, 2012 13:59
Show Gist options
  • Save jnhutchinson/2936607 to your computer and use it in GitHub Desktop.
Save jnhutchinson/2936607 to your computer and use it in GitHub Desktop.
lsf.wait.sh
wait.on.lsf() { ## wait on jobs{
n=`bjobs -P $projectID | awk 'NR>1' | wc -l`
while [ $n -ne 0 ]
do
n=`bjobs -P $projectID | awk 'NR>1' | wc -l`
# number of running
echo "Running: "`bjobs -P $projectID | grep RUN | wc -l`
# number of pending
echo "Pending: "`bjobs -P $projectID | grep PEND | wc -l`
sleep 60 ##raising this to 120 will cause LSF to drop the script
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment