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 does it’s job but it is imcomplete… can you help correct the errors?

md5sum md5


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


convertsecs() {
 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/; # make script executable

./scripts/; # run