- Timestamp:
- 02/28/2012 06:12:12 PM (13 years ago)
- Branches:
- ablfs
- Children:
- 9d0e0eb
- Parents:
- 52389b5
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
common/create-sbu_du-report.sh
r52389b5 r6cf2868 52 52 53 53 # Match the first timed log to extract the SBU unit value from it 54 BASELOG=`grep -l "^Totalseconds:" $LOGSDIR/* | head -n1` 54 FIRSTLOG=`grep -l "^Totalseconds:" $LOGSDIR/* | head -n1` 55 BASELOG=`grep -l "^Totalseconds:" $LOGSDIR/???-binutils* | head -n1` 55 56 echo -e "\nUsing ${BASELOG#*[[:digit:]]-} to obtain the SBU unit value." 56 57 SBU_UNIT=`sed -n 's/^Totalseconds:\s\([[:digit:]]*\)$/\1/p' $BASELOG` … … 92 93 # Append installed files disk usage to the previous entry, 93 94 # except for the first parsed log 94 if [ "$log" != "$ BASELOG" ] ; then95 if [ "$log" != "$FIRSTLOG" ] ; then 95 96 INSTALL=`perl -e 'print ('$DU1' - '$DU1PREV')';` 96 97 INSTALLMB=`perl -e 'printf "%.3f" , ('$DU1MB' - '$DU1MBPREV')';` … … 116 117 done 117 118 119 # For printing the last 'Installed files disk usage', we need to 'du' the 120 # root dir, excluding the jhalfs directory (and lost+found). We assume 121 # that the rootdir is $LOGSDIR/../.. 122 DU1=`du -skx --exclude=jhalfs --exclude=lost+found $LOGSDIR/../.. | cut -f1` 123 DU1MB=`perl -e 'printf "%.3f" , ('$DU1' / '1024')';` 124 INSTALL=`perl -e 'print ('$DU1' - '$DU1PREV')';` 125 INSTALLMB=`perl -e 'printf "%.3f" , ('$DU1MB' - '$DU1MBPREV')';` 126 echo -e "Installed files disk usage:\t\t\t\t$INSTALL KB or $INSTALLMB MB\n" >> $REPORT 127 # Append install values for grand total 128 INSTALL2=`perl -e 'printf "%.3f" , ('$INSTALL2' + '$INSTALL')';` 129 INSTALLMB2=`perl -e 'printf "%.3f" , ('$INSTALLMB2' + '$INSTALLMB')';` 130 118 131 # Dump grand totals 119 132 echo -e "\n$LINE\n\nTotal time required to build the systen:\t\t$SBU2 SBU" >> $REPORT
Note:
See TracChangeset
for help on using the changeset viewer.