-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcondorq_all.sh
More file actions
executable file
·23 lines (18 loc) · 932 Bytes
/
Copy pathcondorq_all.sh
File metadata and controls
executable file
·23 lines (18 loc) · 932 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash
USER=$1
if [ -z "$USER" ]; then
USER=pedrok
fi
AWKCMD='{ split($0,a," "); j1 += a[1]; j2 += a[3]; j3 += a[5]; j4 += a[7]; j5 += a[9]; j6 += a[11]; j7 += a[13];} END { print j1,"jobs;",j2,"completed,",j3,"removed,",j4,"idle,",j5,"running,",j6,"held,",j7,"suspended"}'
GREPCMD="completed"
CONDORV=$(condor_q -version | grep CondorVersion | awk '{print $2}')
IFS="." read -a CONDORVARRAY <<< "$CONDORV"
FLAG="-submitter"
if [ "${CONDORVARRAY[0]}" -ge 9 ]; then
FLAG=""
fi
if [ "${CONDORVARRAY[0]}" -gt 8 ] || ( [ "${CONDORVARRAY[0]}" -eq 8 ] && [ "${CONDORVARRAY[1]}" -ge 6 ] ); then
AWKCMD='{ split($0,a," "); j1 += a[4]; j2 += a[6]; j3 += a[8]; j4 += a[10]; j5 += a[12]; j6 += a[14]; j7 += a[16];} END { print j1,"jobs;",j2,"completed,",j3,"removed,",j4,"idle,",j5,"running,",j6,"held,",j7,"suspended"}'
GREPCMD="query"
fi
condor_q $FLAG $USER -totals | grep -F "$GREPCMD" | grep -vF "all users" | awk "$AWKCMD"