Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- #########################################
- # #
- # Performance-Skript zum erstellen der #
- # Performance Tests #
- # #
- #########################################
- DATE=`/bin/date +%Y%m%d-%H%M` # Datum zur Dokumentation
- LOG_DIR=/root/performancetest_$DATE # Speicherort der LOG-Dateien
- DIR=/srv/cloud # Ort zum durchfuehren der Performance-Tests
- MKLOG_DIR=`mkdir -p $LOG_DIR` # Erstellen des LOG-Verzeichnisses
- RAM_SIZE=`free -m | grep 'Mem:' | awk '{print $2}'` # ermittelt die RAM-Groesse
- SIZE=$(echo "scale=0;`free -m | grep 'Mem:' | awk '{print $2}'`*2" | bc -l) # Verdoppelt die RAM-Groesse
- HINWEISE=phys_moosefs_1_szenario4 # Hinweise fuer die performancetests
- echo "$HINWEISE" >> $LOG_DIR/info.txt
- echo "Startzeit des Skirpts: " `/bin/date +%Y%m%d-%H:%M:%S` >> $LOG_DIR/info.txt
- echo "RAM groesse: " $RAM_SIZE >> $LOG_DIR/info.txt
- echo "Dateigroesse: " $SIZE >> $LOG_DIR/info.txt
- # Bonnie++
- echo "### Bonnie gestartet: " `/bin/date +%H:%M:%S` >> $LOG_DIR/info.txt
- bonnie++ -n 10 -u 0 -r $RAM_SIZE -s $SIZE -d $DIR -q | bon_csv2html > $LOG_DIR/resultat-$DATE.html
- echo "### Bonnie gestopt: " `/bin/date +%H:%M:%S` >> $LOG_DIR/info.txt
- # dd-Sync
- echo "### dd-sync gestartet: " `/bin/date +%H:%M:%S` >> $LOG_DIR/info.txt
- dd if=/dev/zero of=$DIR/test bs=1024000 count=$SIZE oflag=sync &> $LOG_DIR/dd_sync_$DATE.log
- echo "### dd-sync gestopt: " `/bin/date +%H:%M:%S` >> $LOG_DIR/info.txt
- rm -rf $DIR/test
- echo "dd-sync-Datei geloescht" >> $LOG_DIR/info.txt
- # dd-Direct
- echo "### dd-direct gestartet: " `/bin/date +%H:%M:%S` >> $LOG_DIR/info.txt
- dd if=/dev/zero of=$DIR/test bs=1024000 count=$SIZE oflag=direct &> $LOG_DIR/dd_direct_$DATE.log
- echo "### dd-direct gestopt: " `/bin/date +%H:%M:%S` >> $LOG_DIR/info.txt
- rm -rf $DIR/test # Datei loeschen
- echo "dd-direct-Datei geloescht" >> $LOG_DIR/info.txt
- echo "Endzeit des Skirpts: " `/bin/date +%Y%m%d-%H:%M:%S` >> $LOG_DIR/info.txt
- # Erstellte Dateien löschen
- rm -rf $DIR/test
- # Paket erstellen und an Desktoprechner senden
- cd $LOG_DIR
- tar cfvz /root/performance_$HINWEISE.tar.gz *
- scp performance_$HINWEISE.tar.gz chraible@10.10.16.94:/home/chraible/Desktop/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement