Skip to content

Commit 6a370fa

Browse files
author
root
committed
add condor history script
1 parent 913c72c commit 6a370fa

File tree

1 file changed

+22
-0
lines changed

1 file changed

+22
-0
lines changed

scripts/hist-condor.sh

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
3+
today=$(date --date='00:00:00 today' +%s)
4+
yesterday=$(date --date='00:00:00 yesterday' +%s)
5+
output=$(date --date='yesterday' +%Y%m%d )-$(hostname -s)
6+
7+
condor_history=$(/usr/bin/condor_history -const "EnteredCurrentStatus >= $yesterday && EnteredCurrentStatus < $today && RemoteWallclockTime !=0" -format "clusterid=%v; " ClusterId \
8+
-format "CE_JobId=%v; " RoutedFromJobId -format "owner=%s; " Owner -format "VO=%s; " x509UserProxyVOName -format "userDN=%s; " x509userproxysubject \
9+
-format "userFQAN=%s; " x509UserProxyFirstFQAN -format "exec_host=%s; " LastRemoteHost \
10+
-format "request_cpus=%d; " RequestCPUs -format "cputime=%f; " RemoteUserCpu -format "syscputime=%f; " RemoteSysCpu -format "jobduration=%f; " JobDuration \
11+
-format "walltime+suspensiontime=%f; " RemoteWallclockTime -format "suspensiontime=%f; " CumulativeSuspensionTime \
12+
-format "cputmult=%v; " MATCH_EXP_PICScaling -format "pmem=%v; " ResidentSetSize_RAW -format "vmem=%d; " ImageSize_RAW -format "disk=%d; " DiskUsage_RAW \
13+
-format "ExitCode=%v; " ExitCode -format "ExitSignal=%v; " ExitSignal -format "LastStatus=%v; " LastJobStatus -format "JobStatus=%v; " JobStatus \
14+
-format "startdate=%d; " JobStartDate -format "enddate=%d\n" EnteredCurrentStatus)
15+
16+
while read line; do
17+
epoch_date=$(echo $line | awk -Fenddate= '{print $2}')
18+
pbs_date=$(date +"%Y-%m-%d %H:%M:%S" -d@$epoch_date)
19+
timeline=$(echo "timestamp=$pbs_date; $line")
20+
echo ${timeline//pmem=undefined/pmem=0}
21+
done <<< "$condor_history" > /var/lib/condor/accounting/$output
22+

0 commit comments

Comments
 (0)