bootstrap/cleanup.sh

19 lines
716 B
Bash
Raw Permalink Normal View History

2018-06-11 04:25:29 +02:00
#! /bin/sh
2023-10-17 13:25:13 +02:00
# SPDX-FileCopyrightText: 2023 Tobias Schmidl
#
# SPDX-License-Identifier: AGPL-3.0-or-later
2019-06-05 09:20:09 +02:00
rm -rf /root/.cache /root/.rnd
2019-06-05 09:20:59 +02:00
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 '{}' '+'
2018-06-11 08:44:52 +02:00
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
2023-10-17 13:36:43 +02:00
truncate -s0 "$HOME"/.bash_history
[ -w "$HOME"/.zsh_history ] && truncate -s0 "$HOME"/.zsh_history
2018-06-11 08:44:52 +02:00
find /var/log -type f -exec truncate -s0 '{}' '+'
2019-04-12 09:47:00 +02:00
dd if=/dev/zero of=/emptyfile oflag=dsync status=progress bs=4M;
2018-06-11 08:44:52 +02:00
rm -f /emptyfile;
2021-09-24 11:14:38 +02:00
systemctl poweroff