2018-08-01 12:29:58 -04:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
#Copyright (c) 2016 Wind River Systems, Inc.
|
|
|
|
#
|
|
|
|
#SPDX-License-Identifier: Apache-2.0
|
|
|
|
#
|
|
|
|
# This script removes uncompressed file. It can save a huge amount of disk space
|
2018-08-30 14:50:33 +08:00
|
|
|
# on the analysis server. Run this script after the very last time the data is parsed
|
|
|
|
# and BEFORE running parse-daily.sh script.
|
|
|
|
# If it is run after each intermediary parse, the download-data.sh script will download the
|
2018-08-01 12:29:58 -04:00
|
|
|
# uncompressed files again.
|
|
|
|
|
|
|
|
if [ ! -f lab.conf ]; then
|
2018-08-30 14:50:33 +08:00
|
|
|
echo "Lab configuration file is missing."
|
|
|
|
echo "See http://wiki.wrs.com/PBUeng/TitaniumServerSysengToolsAndDataAnalysis for more info."
|
|
|
|
exit 1
|
2018-08-01 12:29:58 -04:00
|
|
|
fi
|
|
|
|
|
|
|
|
source ./lab.conf
|
|
|
|
YEAR=`date +'%Y'`
|
|
|
|
|
|
|
|
files="${FILE_LIST// /, }"
|
|
|
|
read -p "Are you sure you want to remove all uncompressed $files files? [Y/N]: " -n 1 -r
|
|
|
|
echo
|
2018-09-05 01:10:16 +08:00
|
|
|
if [[ $REPLY =~ ^[Y]$ ]]; then
|
2018-08-01 12:29:58 -04:00
|
|
|
for FILE in ${FILE_LIST}; do
|
|
|
|
rm -v */*_${YEAR}-*${FILE}
|
|
|
|
done
|
|
|
|
else
|
|
|
|
echo "Remove request cancelled."
|
|
|
|
fi
|
|
|
|
|