forked from sscruz/susyMaintenanceScripts
-
Notifications
You must be signed in to change notification settings - Fork 1
/
countBatchJobs.sh
35 lines (30 loc) · 1.01 KB
/
countBatchJobs.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/bash
#for i in {1..10000}
USER=""
if [ $# -eq 0 ]
then
USER=`whoami`
else
USER=${1}
fi
LIP=true
if [ `which qstat ` ]
then
LIP=false
fi
while true ;
do
if [ ${LIP} ]
then
if [ "${USER}" = "stalker" ]
then
echo "You are running in stalker mode, jajajajajajajajajaja"
echo "Vischia( run: " `qstat -u vischia | grep " r " | wc -l` ", wait: " `qstat -u vischia | grep " qw " | wc -l` "). Cris( run: " `qstat -u cbeiraod | grep " r " | wc -l` ", wait: " `qstat -u cbeiraod | grep " qw " | wc -l` "). Bargassa( run: " `qstat -u bargassa | grep " r " | wc -l` ", wait: " `qstat -u bargassa | grep " qw " | wc -l` ")"
else
echo "running: " `qstat -u ${USER} | grep " R " | wc -l` " waiting: " `qstat -u ${USER} | grep " Q " | wc -l` " completed: " `qstat -u ${USER} | grep " C " | wc -l`
fi
else
echo "RUNNING: `bjobs | grep " R " | wc -l` PENDING: `bjobs | grep " Q " | wc -l` COMPLETED: `bjobs | grep " C " | wc -l`"
fi
sleep 5
done