-
Notifications
You must be signed in to change notification settings - Fork 73
/
cleanup_range
executable file
·21 lines (18 loc) · 1.18 KB
/
cleanup_range
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash
#Cleaning results from a range of test numbers
source ./config
source ./param
START=$1
END=$2
RESULTPSQL="psql -h $RESULTHOST -U $RESULTUSER -p $RESULTPORT -d $RESULTDB"
pushd "results/${SERVERNAME}"
$RESULTPSQL -At -c "SELECT test FROM tests WHERE server='${SERVERNAME}' AND test>=$START AND test<=$END" | xargs rm -rf
$RESULTPSQL -At -c "DELETE FROM test_bgwriter WHERE server='${SERVERNAME}' AND test>=$START AND test<=$END"
$RESULTPSQL -At -c "DELETE FROM test_stat_database WHERE server='${SERVERNAME}' AND test>=$START AND test<=$END"
$RESULTPSQL -At -c "DELETE FROM test_statio WHERE server='${SERVERNAME}' AND test>=$START AND test<=$END"
$RESULTPSQL -At -c "DELETE FROM tests WHERE server='${SERVERNAME}' AND test>=$START AND test<=$END"
$RESULTPSQL -At -c "DELETE FROM test_metrics_data WHERE server='${SERVERNAME}' AND test>=$START AND test<=$END"
$RESULTPSQL -At -c "DELETE FROM test_settings WHERE server='${SERVERNAME}' AND test>=$START AND test<=$END"
$RESULTPSQL -At -c "DELETE FROM test_statements WHERE server='${SERVERNAME}' AND test>=$START AND test<=$END"
$RESULTPSQL -At -c "DELETE FROM test_buffercache WHERE server='${SERVERNAME}' AND test>=$START AND test<=$END"
popd