clean up base log dir

The base log dir is getting messy.
Let's clean it up a little.

Change-Id: I09e1e32f64a0b23f193a05f05792c94ff5839179
This commit is contained in:
Wes Hayutin 2019-03-11 15:54:51 -06:00 committed by wes hayutin
parent 05cb96dc29
commit bb06f25045
1 changed files with 12 additions and 1 deletions

View File

@ -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
}