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