this benchmark tests harddisk and cpu by creating a 1GB file and meassures the time it takes to md5sum that file.

so you can calculate how long it is going to take to md5sum 1TB…

this script md5sumBenchmark.sh does it’s job but it is imcomplete… can you help correct the errors?

md5sum md5

benchmark

mkdir scripts; # create new folder
vim ./scripts/md5sumBenchmark.sh;  # create new file and open it, fill it with this content

#!/bin/bash

convertsecs() {
 ((h=${1}/3600))
 ((m=(${1}%3600)/60))
 ((s=${1}%60))
 printf "%02d:%02d:%02dn" $h $m $s
}

echo "===================== md5sum benchmark";

echo "======== generate 1GB test file";

dd if=/dev/zero of=md5sumTestFile count=1048576 bs=1024;
du -h md5sumTestFile;

echo "======== start:";date +"%T";
timestampStart=$(date +%s);

md5sum md5sumTestFile;

echo "======== start:";date +"%T";
timestampStop=$(date +%s);

timestampDiff=$(expr $timestampStop - $timestampStart);

echo "======== finished in:"; echo $timestampDiff; echo " Seconds";

echo "so it would take ";
timestampDiff=$(expr $timestampDiff * 1024);

echo $(convertsecs $timestampDiff);

echo " to md5sum for 1TB";

# removing test file
rm -rf md5sumTestFile;

# write and quit

chmod u+x ./scripts/md5sumBenchmark.sh; # make script executable

./scripts/md5sumBenchmark.sh; # run
admin