diff options
author | Aaron LI <aly@aaronly.me> | 2017-12-07 20:23:26 +0800 |
---|---|---|
committer | Aaron LI <aly@aaronly.me> | 2017-12-07 20:23:26 +0800 |
commit | 75b2f56efcabd75d2f39089049075993dd3fd9f3 (patch) | |
tree | 28b889c14727cdb5dd400d3c607714d23307e765 /unix | |
parent | 2dd1566d650402daebfc3e1a47cf05be59745ac3 (diff) | |
download | atoolbox-75b2f56efcabd75d2f39089049075993dd3fd9f3.tar.bz2 |
Add unix/iotest.sh: a simple IO test tool using dd
Diffstat (limited to 'unix')
-rw-r--r-- | unix/iotest.sh | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/unix/iotest.sh b/unix/iotest.sh new file mode 100644 index 0000000..fe81c97 --- /dev/null +++ b/unix/iotest.sh @@ -0,0 +1,20 @@ +#!/bin/sh +# +# Simple test to the disk write speed using `dd`. +# +# Aaron LI +# 2017-11-06 +# + +IN=/dev/zero +OUT=/tmp/iotest.$$ +BS=16k +COUNT=16000 + +RESULT=${HOME}/iotest.txt + +CMD="dd if=${IN} of=${OUT} bs=${BS} count=${COUNT} conv=sync" +SPEED=$(${CMD} 2>&1 | grep 'bytes/sec' | awk -F'[()]' '{ print $2 }') +rm ${OUT} +DATE=$(date +'%Y-%m-%d %H:%M') +echo "${DATE} ${BS}*${COUNT} ${SPEED}" >> ${RESULT} |