1#! /bin/bash 2 3echo "## Start Test" 4date 5date +%s 6if [ -d ./00 ] ; then 7/bin/rm -fr ./00 >& /dev/null 8fi 9STARTT=`date +%s` 10echo $STARTT 11 12echo "" 13echo "## Create files " 14time ~/fs-bench/cr 15 16echo "" 17echo "## tar all " 18MAXFILE=`tar cBf - 00 | tar tvBf - 2>&1 | tail -n 1 | awk '{print $6;}'| awk -F'/' '{print $4;}'` 19HALFFILE=`echo "obase=F;ibase=F;$MAXFILE/2" | bc` 20 21echo "" 22echo "## Remove all files and directories" 23/bin/rm -fr ./00 >& /dev/null 24 25echo "" 26echo "## Create half files" 27echo create half files 28time ~/fs-bench/cr $HALFFILE 29 30echo "" 31echo "## Change owner" 32time chown -R $USER ./00 33 34echo "" 35echo "## random access" 36time ~/fs-bench/ra $HALFFILE 37 38 39echo "" 40echo "## Change mode " 41time chmod -R go+rw ./00 42 43echo "" 44echo "## Random delete and create" 45time ~/fs-bench/radc $HALFFILE 46 47echo "" 48echo "## Change mode again" 49time chmod -R go-rw ./00 50 51echo "" 52echo "## Remove all files and directories" 53time /bin/rm -fr ./00 54 55echo "" 56echo "## Finish test" 57date 58ENDT=`date +%s` 59echo $ENDT 60echo -n 'TOTAL(seconds): ' 61expr $ENDT - $STARTT 62 63 64