-
Notifications
You must be signed in to change notification settings - Fork 8
/
gexml
executable file
·59 lines (47 loc) · 999 Bytes
/
gexml
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/bash
# Exporting Environment Variables
#########################################
source ./phpqstat.conf
#########################################
#set -xv
while getopts RMfh:g:u:o:e:s:j:q: OPTION
do
case $OPTION in
s) state=$OPTARG
stateopt="-s $state"
;;
g) group=$OPTARG
groupopt="-u $group*"
;;
u) user=$OPTARG
if [ $user == "all" ]; then
user="*"
useropt="-u"
else
group=$(id -gn $user)
useropt="-u"
fi
;;
o) out=$OPTARG
;;
e) error=$OPTARG
erroropt="-explain $error"
;;
j) jobid=$OPTARG
jobidopt="-j $jobid"
;;
q) queue=$OPTARG
queueopt="-q $queue"
;;
R) sw_R="-g c" #queues status
;;
M) sw_M=1
;;
f) sw_f="-f"
;;
h) help $tipus_usuari ;;
?) echo "Opcio invalida."; exit ;;
esac
done
qstat -xml -r $stateopt $queueopt $sw_R $sw_f $groupopt $useropt "$user" $erroropt $jobidopt > $out
exit