-
Notifications
You must be signed in to change notification settings - Fork 73
/
wipe_server
executable file
·23 lines (19 loc) · 947 Bytes
/
wipe_server
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/bash -ex
if [ -z "$1" ]; then
echo Usage: wipe_server servername
exit 1
fi
source ./config
SERVERNAME=$1
RESULTPSQL="psql -h $RESULTHOST -U $RESULTUSER -p $RESULTPORT -d $RESULTDB"
$RESULTPSQL -c "DELETE FROM test_bgwriter WHERE server='${SERVERNAME}';"
$RESULTPSQL -c "DELETE FROM test_metrics_data WHERE server='${SERVERNAME}';"
$RESULTPSQL -c "DELETE FROM test_stat_database WHERE server='${SERVERNAME}';"
$RESULTPSQL -c "DELETE FROM test_statio WHERE server='${SERVERNAME}';"
$RESULTPSQL -c "DELETE FROM test_buffercache WHERE server='${SERVERNAME}';"
$RESULTPSQL -c "DELETE FROM test_settings WHERE server='${SERVERNAME}';"
$RESULTPSQL -c "DELETE FROM test_statements WHERE server='${SERVERNAME}';"
$RESULTPSQL -c "DELETE FROM tests WHERE server='${SERVERNAME}';"
$RESULTPSQL -c "DELETE FROM testset WHERE server='${SERVERNAME}';"
$RESULTPSQL -c "DELETE FROM server WHERE server='${SERVERNAME}';"
rm -rf results/${SERVERNAME}