Add 'cleanup/' from commit 'b1a5f3d704dc5af9da3b3ef7c43dadcbcd1bf2fc'

git-subtree-dir: cleanup
git-subtree-mainline: 6b9a2380ce
git-subtree-split: b1a5f3d704
This commit is contained in:
Tobias Schmidl 2023-07-25 08:36:19 +02:00
commit cbe837176f

14
cleanup/cleanup.sh Normal file
View file

@ -0,0 +1,14 @@
#! /bin/sh
rm -rf /root/.cache /root/.rnd
find /tmp -type d -name 'systemd-*-systemd-timesyncd.service*' -exec rm -rf '{}' '+'
find /var/tmp -type d -name 'systemd-*-systemd-timesyncd.service*' -exec rm -rf '{}' '+'
find /var/lib/apt -type f -delete
find /var/cache/apt -type f -delete
find /var/log -type f -regextype posix-extended -regex '.*\.(gz|xz|[0-9])' -delete
truncate -s0 $HOME/.bash_history
[ -w $HOME/.zsh_history ] && truncate -s0 $HOME/.zsh_history
find /var/log -type f -exec truncate -s0 '{}' '+'
dd if=/dev/zero of=/emptyfile oflag=dsync status=progress bs=4M;
rm -f /emptyfile;
systemctl poweroff