summaryrefslogtreecommitdiff
path: root/etc/tasks/999-clean.sh
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2018-12-04 13:56:13 -0500
committerJoseph Hunkeler <jhunkeler@gmail.com>2018-12-04 13:56:13 -0500
commit4f35c93fdebe4b06cfa4a50e79d510ae1729a704 (patch)
tree2cb4cb2ee1abdf53554d5668e51f96fa2070800c /etc/tasks/999-clean.sh
downloaddocker-python-4f35c93fdebe4b06cfa4a50e79d510ae1729a704.tar.gz
Initial commit
Diffstat (limited to 'etc/tasks/999-clean.sh')
-rwxr-xr-xetc/tasks/999-clean.sh17
1 files changed, 17 insertions, 0 deletions
diff --git a/etc/tasks/999-clean.sh b/etc/tasks/999-clean.sh
new file mode 100755
index 0000000..44f5d16
--- /dev/null
+++ b/etc/tasks/999-clean.sh
@@ -0,0 +1,17 @@
+#!/bin/bash
+if [[ ! -f /.dockerenv ]]; then
+ echo "This script cannot be executed outside of a docker container."
+ exit 1
+fi
+
+sudo yum clean all
+
+sudo rm -rf "${HOME}/.astropy"
+sudo rm -rf "${HOME}"/*
+sudo rm -rf /tmp/*
+sudo rm -rf /var/cache/yum
+
+for logfile in /var/log/*
+do
+ [[ -f ${logfile} ]] && sudo truncate --size=0 "${logfile}"
+done