-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcmrstarts
executable file
·22 lines (21 loc) · 1.02 KB
/
cmrstarts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/sh
tmpf=$(mktemp --tmpdir cmrtmp.XXX)
condor_q -allusers -nobatch -af:jh, JobStatus Owner JobCategory JobStartDate \
JobCurrentStartDate RemoteUserCpu ServerTime-JobCurrentStartDate \
"splitSlotName(RemoteHost)[1]" CpusProvisioned | tr -d ' ' > $tmpf
cat $tmpf | \
mlr --icsv --opprint --right --tz Europe/Amsterdam then \
filter '$JobStatus == 2' then \
sort -n JobCurrentStartDate then \
rename splitSlotName\(RemoteHost\)[1],fred then \
rename ServerTime-JobCurrentStartDate,WallTime then \
put '$CurrentStart=sec2localtime($JobCurrentStartDate)' then \
put 'if ($JobCurrentStartDate == $JobStartDate) {
$FirstStart=" --- " } else {
$FirstStart=" ".sec2localtime($JobStartDate)}' then \
put '$exec_host=" ".gsub($fred,".nikhef.nl.*","")' then \
put 'if ($exec_host == "error") {
$exec_host=" DAG? " ; $CpusProvisioned=0 }' then \
cut -x -f JobStartDate,JobCurrentStartDate,fred then \
reorder -f CurrentStart,FirstStart -a JobCategory then cat
rm $tmpf