File tree 1 file changed +22
-0
lines changed
1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change
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
+
You can’t perform that action at this time.
0 commit comments