-
Notifications
You must be signed in to change notification settings - Fork 73
/
Copy pathcleanup_fromvalue
executable file
·19 lines (16 loc) · 1 KB
/
cleanup_fromvalue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash
#Cleaning results from test number and all higher numbers
source ./config
source ./params
TEST=$1
pushd "results/${SERVERNAME}"
psql -d results -At -c "SELECT test FROM tests WHERE server='${SERVERNAME}' AND test>=$TEST" | xargs rm -rf
psql -d results -At -c "DELETE FROM test_bgwriter WHERE server='${SERVERNAME}' AND test>=$TEST"
psql -d results -At -c "DELETE FROM test_stat_database WHERE server='${SERVERNAME}' AND test>=$TEST"
psql -d results -At -c "DELETE FROM test_statio WHERE server='${SERVERNAME}' AND test>=$TEST"
psql -d results -At -c "DELETE FROM tests WHERE server='${SERVERNAME}' AND test>=$TEST"
psql -d results -At -c "DELETE FROM test_metrics_data WHERE server='${SERVERNAME}' AND test>=$TEST"
psql -d results -At -c "DELETE FROM test_settings WHERE server='${SERVERNAME}' AND test>=$TEST"
psql -d results -At -c "DELETE FROM test_statements WHERE server='${SERVERNAME}' AND test>=$TEST"
psql -d results -At -c "DELETE FROM test_buffercache WHERE server='${SERVERNAME}' AND test>=$TEST"
popd