Commit ef769319 authored by Alain O' Miniussi's avatar Alain O' Miniussi

print cpu time per team.

parent 04351dc9
#!/usr/bin/env bash
sdate=01.01.19
edate=02.01.19
# Labs are directly under the root account
# There is a documented bug in sacct that will print all accounts whatever the filter
# That is, Parent=root only main concequence is that the parent name will only be printed
......@@ -9,10 +12,12 @@ labs=$(sacctmgr show account WithAssoc format=Account,ParentName Parent=root -P
for lab in $labs
do
echo Lab: $lab
teams=$(sacctmgr show account WithAssoc format=Account,ParentName Parent=$lab -P -n | egrep -v "\|$" | sed -e "s/|$lab//")
for team in $teams
do
echo Team: $team
cpu_time=$((echo 0; sacct -n -X -S $sdate -E $edate -o CPUTimeRAW -A $team) | paste -sd+ - | bc)
echo $lab:$team:$cpu_time
done
cpu_time=$((echo 0; sacct -n -X -S $sdate -E $edate -o CPUTimeRAW -A $lab) | paste -sd+ - | bc)
echo $lab:other:$cpu_time
done
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment