From 48a05628c76ec4bac61361dde39342a0eb9be59b Mon Sep 17 00:00:00 2001 From: Joseph Hunkeler Date: Thu, 6 Dec 2018 01:27:29 -0500 Subject: Initial commit of jwstdp * Unstable * Incomplete --- etc/jwstdp-latest/tasks/999-clean.sh | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 etc/jwstdp-latest/tasks/999-clean.sh (limited to 'etc/jwstdp-latest/tasks/999-clean.sh') diff --git a/etc/jwstdp-latest/tasks/999-clean.sh b/etc/jwstdp-latest/tasks/999-clean.sh new file mode 100755 index 0000000..7487b9c --- /dev/null +++ b/etc/jwstdp-latest/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