From c8ad645d8827bdd9fedc19a8c67f22aa016f8290 Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Fri, 15 Feb 2019 22:11:56 -0500 Subject: Refactor build/publish --- etc/jwstdp-snapshot/tasks/999-clean.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 etc/jwstdp-snapshot/tasks/999-clean.sh (limited to 'etc/jwstdp-snapshot/tasks/999-clean.sh') diff --git a/etc/jwstdp-snapshot/tasks/999-clean.sh b/etc/jwstdp-snapshot/tasks/999-clean.sh new file mode 100755 index 0000000..7487b9c --- /dev/null +++ b/etc/jwstdp-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