A report needs to come some what similar to this
No of elements Stream Batch No Load time
A B C D
A,B,C im able to get quite easily
wc -l /usr/local/intranet/areas/prod/output/SRGW_0?/*/MESSAGE_T.dat
O/P of above command.
A B C
75/usr/local/intranet/areas/prod/output/SRGW_05/153907/MESSAGE_T.dat
26 /usr/local/intranet/areas/prod/output/SRGW_05/153908/MESSAGE_T.dat
110 /usr/local/intranet/areas/prod/output/SRGW_05/153909/MESSAGE_T.dat
wc -l /usr/local/intranet/areas/prod/output/SRGW_05/*/MESSAGE_T.dat | cut -f1,8,9 -d"/"
O/P of above command.
159 /SRGW_05/153917
367 /SRGW_05/153918
21 /SRGW_05/153919
12 /SRGW_05/153920
88 /SRGW_05/153921
35 /SRGW_05/153922
36 /SRGW_05/153923
For D I need to check every 2 Batches and compare so I need to put it in a loop
Load time needs to be time stamp of folder created of C.
ls -lrt /usr/local/intranet/areas/prod/output/SRGW_0?/
O/P of above command.
drwxr-xr-x 2 mtsadm mts 4096 Mar 13 10:44 153913
drwxr-xr-x 2 mtsadm mts 4096 Mar 13 10:48 153914
drwxr-xr-x 2 mtsadm mts 4096 Mar 13 10:53 153915
drwxr-xr-x 2 mtsadm mts 4096 Mar 13 10:57 153916
drwxr-xr-x 2 mtsadm mts 4096 Mar 13 11:01 153917
drwxr-xr-x 2 mtsadm mts 4096 Mar 13 11:05 153918
drwxr-xr-x 2 mtsadm mts 4096 Mar 13 11:10 153919
drwxr-xr-x 2 mtsadm mts 4096 Mar 13 11:14 153921
drwxr-xr-x 2 mtsadm mts 4096 Mar 13 11:14 153920
Load time of 153913 = 4 minutes.
I need to in corporate a logic similar to this but need to do it in a loop as there are many directories for load time calculation.
Store in a variable = ls -lrt /usr/local/intranet/areas/prod/output/SRGW_05/ | cut -f24 -d" "
h1=`echo $T1|cut -d: -f1`
m1=`echo $T1|cut -d: -f2`
x1=`echo "$h1*60 + $m1"|bc -l`
h2=`echo $T2|cut -d: -f1`
m2=`echo $T2|cut -d: -f2`
x2=`echo "$h2*60 + $m2"|bc -l`
if test $x1 -lt $x2
then
diff=`echo "$x2 - $x1"|bc -l`
else
diff=`echo "$x1 - $x2"|bc -l`
fi
echo "Load time is $diff"
Entire O/p should be like this eventually
No of elements Stream Batch No Load time
A B C D
Can some one help me ?
My OS is AIX