From 79c25396b4a59b63844022ca7f650a0654b8c160 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Fri, 15 Feb 2019 22:13:21 -0500 Subject: Add hstdp snapshot --- etc/hstdp-snapshot/tasks/999-clean.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 etc/hstdp-snapshot/tasks/999-clean.sh (limited to 'etc/hstdp-snapshot/tasks/999-clean.sh') diff --git a/etc/hstdp-snapshot/tasks/999-clean.sh b/etc/hstdp-snapshot/tasks/999-clean.sh new file mode 100755 index 0000000..7487b9c --- /dev/null +++ b/etc/hstdp-snapshot/tasks/999-clean.sh @@ -0,0 +1,18 @@ +#!/bin/bash -x +if [[ ! -f /.dockerenv ]]; then + echo "This script cannot be executed outside of a docker container." + exit 1 +fi + +rm -rf "${HOME}/.astropy" +rm -rf "${HOME}/.cache" +rm -rf "${HOME}"/* + +sudo yum clean all +sudo rm -rf /tmp/* +sudo rm -rf /var/cache/yum + +for logfile in /var/log/* +do + sudo truncate --size=0 "${logfile}" +done -- cgit