1
0
Fork 0

Updated gentasktime script to handle weeks in relative output

This will have the nice effect of compressing old data
master
Mike Gerwitz 2013-09-05 11:07:14 -04:00
parent d5dc7c76d8
commit 1f83630527
1 changed files with 6 additions and 3 deletions

View File

@ -25,12 +25,15 @@ domake \
last="" last=""
} }
/days ago|^(1[5-9]|2[0-9]) hours ago/{ /(days|weeks) ago|^(1[5-9]|2[0-9]) hours ago/{
if ( $0 ~ /hours/ ) { if ( $0 ~ /hours/ ) {
$1 = 1 $1 = 1
} }
if ( $0 ~ /weeks/ ) {
$1 = $1*7
}
if ( $1 == last ) next; if ( $1 == last ) next;
if ( $1 < last ) nextfile; if ( $1 < last ) next;
last = $1; last = $1;
print $1, $NF; print $1, $NF;
} }
@ -41,6 +44,6 @@ domake \
&& echo -n "-$n " \ && echo -n "-$n " \
&& gendate \ && gendate \
&& tail -n1 taskstats.dat \ && tail -n1 taskstats.dat \
|| exit 1 || { echo "Aborting data gathering."; exit 1; }
done done
) )