From bb06f250451bfbe4868602dd383fbb366885e82a Mon Sep 17 00:00:00 2001 From: Wes Hayutin Date: Mon, 11 Mar 2019 15:54:51 -0600 Subject: [PATCH] clean up base log dir The base log dir is getting messy. Let's clean it up a little. Change-Id: I09e1e32f64a0b23f193a05f05792c94ff5839179 --- .../run-test/templates/oooq_common_functions.sh.j2 | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/roles/run-test/templates/oooq_common_functions.sh.j2 b/roles/run-test/templates/oooq_common_functions.sh.j2 index 952e684d0..a8ba14414 100644 --- a/roles/run-test/templates/oooq_common_functions.sh.j2 +++ b/roles/run-test/templates/oooq_common_functions.sh.j2 @@ -132,11 +132,22 @@ if [ -d /opt/stack/new/tempest/.testrepository ]; then fi SUDO +# clean up base log dir +if [[ -e $LOGS_DIR/releases.sh ]]; then + mv $LOGS_DIR/releases.sh $LOGS_DIR/quickstart_files/ +fi +if [[ -e $LOGS_DIR/playbook_executions.log ]]; then + mv $LOGS_DIR/playbook_executions.log $LOGS_DIR/quickstart_files/ +fi +if [[ -e $LOGS_DIR/emit_releases_file.log ]]; then + mv $LOGS_DIR/emit_releases_file.log $LOGS_DIR/quickstart_files/ +fi + # record the size of the logs directory # -L, --dereference dereference all symbolic links # Note: tail -n +1 is to prevent the error 'Broken Pipe' e.g. 'sort: write failed: standard output: Broken pipe' -du -L -ch $LOGS_DIR/* | tail -n +1 | sort -rh | head -n 200 &> $LOGS_DIR/log-size.txt || true +du -L -ch $LOGS_DIR/* | tail -n +1 | sort -rh | head -n 200 &> $LOGS_DIR/quickstart_files/log-size.txt || true END }