forked from Percona-QA/percona-qa
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpquery-del-trial.sh
executable file
·25 lines (22 loc) · 1.23 KB
/
pquery-del-trial.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/bash
# Created by Roel Van de Paar, Percona LLC
TRIAL=$(echo "$1" | sed 's|_val||') # _val: for Valgrind bugs (reducer_val{trial}.sh generated by pquery-prep-red.sh)
if [ "" == "${TRIAL}" ]; then
echo "This script deletes a given pquery trial completely. Execute this script from within the pquery workdir"
echo "Example: to delete trial 10 (./10), execute as: ./delete_single_trial.sh 10"
exit 1
elif [ "`echo ${TRIAL} | sed 's|[0-9]*||'`" != "" ]; then
echo "Trial number should be a numeric value and isn't (value passed to this script which is not considered numeric: '${TRIAL}')"
exit 1
elif [ ! -d ./${TRIAL} ]; then
echo "This script deletes a given pquery trial completely. Execute this script from within the pquery workdir"
echo "Error: trial number '${TRIAL}' was passed as an option to this script. However, no trial ${TRIAL} directory (./${TRIAL}) exists! Please check and retry."
exit 1
fi
rm -Rf ./${TRIAL} > /dev/null 2>&1
rm -f ./reducer${TRIAL}.sh > /dev/null 2>&1
rm -f ./reducer_val${TRIAL}.sh > /dev/null 2>&1
rm -f ./reducer${TRIAL}-*.sh > /dev/null 2>&1
rm -f ./${TRIAL}_bundle > /dev/null 2>&1
rm -f ./${TRIAL}_bundle.tar.gz > /dev/null 2>&1
echo "- pquery trial #${TRIAL} and all related files wiped"