From eea1a2af9965cb7ef45bd1d0d9aaae853caa1c5b Mon Sep 17 00:00:00 2001 From: Tobias Schmidl Date: Mon, 11 Jun 2018 04:25:29 +0200 Subject: [PATCH 01/12] --- cleanup.sh | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 cleanup.sh diff --git a/cleanup.sh b/cleanup.sh new file mode 100644 index 0000000..a0c8f6a --- /dev/null +++ b/cleanup.sh @@ -0,0 +1,8 @@ +#! /bin/sh + +sudo find /var/lib/apt -type f -delete +sudo find /var/cache/apt -type f delete +sudo find /var/log -type f -regextype posix-extend -regex '.*\.(gz|xz|[0-9])' -delete +truncate -s0 $HOME/.bash_history && \ + sudo find /var/log -type f -exec truncate -s0 '{}' '+' && \ + sudo bash -c "dd if=/dev/zero of=/emptyfile bs=4M; rm -f /emptyfile; poweroff" \ No newline at end of file From 7ee0c345478849b78aa863aa5c8fd85076e9cbb3 Mon Sep 17 00:00:00 2001 From: Tobias Schmidl Date: Mon, 11 Jun 2018 08:38:27 +0200 Subject: [PATCH 02/12] From abd7be26343b887dd73d6393eaabec55601f379f Mon Sep 17 00:00:00 2001 From: Tobias Schmidl Date: Mon, 11 Jun 2018 08:44:52 +0200 Subject: [PATCH 03/12] --- cleanup.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/cleanup.sh b/cleanup.sh index a0c8f6a..90842bb 100644 --- a/cleanup.sh +++ b/cleanup.sh @@ -1,8 +1,10 @@ #! /bin/sh -sudo find /var/lib/apt -type f -delete -sudo find /var/cache/apt -type f delete -sudo find /var/log -type f -regextype posix-extend -regex '.*\.(gz|xz|[0-9])' -delete -truncate -s0 $HOME/.bash_history && \ - sudo find /var/log -type f -exec truncate -s0 '{}' '+' && \ - sudo bash -c "dd if=/dev/zero of=/emptyfile bs=4M; rm -f /emptyfile; poweroff" \ No newline at end of file +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 +find /var/log -type f -exec truncate -s0 '{}' '+' +dd if=/dev/zero of=/emptyfile bs=4M; +rm -f /emptyfile; +poweroff From 6be7ab800a73701c424a3137df3bd07eafe7decf Mon Sep 17 00:00:00 2001 From: Tobias Schmidl Date: Mon, 11 Jun 2018 09:18:26 +0200 Subject: [PATCH 04/12] From 51ad5f17688b73657ecab8c620deb74fe6e7f27f Mon Sep 17 00:00:00 2001 From: Tobias Schmidl Date: Fri, 19 Oct 2018 10:45:04 +0200 Subject: [PATCH 05/12] --- cleanup.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/cleanup.sh b/cleanup.sh index 90842bb..b5702ee 100644 --- a/cleanup.sh +++ b/cleanup.sh @@ -4,6 +4,7 @@ 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 bs=4M; rm -f /emptyfile; From cd1f052991bcb03c653e870302daf863cac7fce4 Mon Sep 17 00:00:00 2001 From: Tobias Schmidl Date: Tue, 19 Feb 2019 06:19:09 +0100 Subject: [PATCH 06/12] --- cleanup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cleanup.sh b/cleanup.sh index b5702ee..bb60735 100644 --- a/cleanup.sh +++ b/cleanup.sh @@ -4,7 +4,7 @@ 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 +[ -w $HOME/.zsh_history ] && truncate -s0 $HOME/.zsh_history find /var/log -type f -exec truncate -s0 '{}' '+' dd if=/dev/zero of=/emptyfile bs=4M; rm -f /emptyfile; From c1b90ff2f9e16bc7dbefc2e11d17801d6b1a9c77 Mon Sep 17 00:00:00 2001 From: Tobias Schmidl Date: Fri, 22 Feb 2019 08:55:25 +0100 Subject: [PATCH 07/12] --- cleanup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cleanup.sh b/cleanup.sh index bb60735..1c2ba5f 100644 --- a/cleanup.sh +++ b/cleanup.sh @@ -6,6 +6,6 @@ find /var/log -type f -regextype posix-extended -regex '.*\.(gz|xz|[0-9])' -dele 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 bs=4M; +dd if=/dev/zero of=/emptyfile oflag=sync bs=4M; rm -f /emptyfile; poweroff From 68c9aabe5e00c3c0f33c37703db0031c7fabb850 Mon Sep 17 00:00:00 2001 From: Tobias Schmidl Date: Fri, 22 Feb 2019 08:55:39 +0100 Subject: [PATCH 08/12] --- cleanup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cleanup.sh b/cleanup.sh index 1c2ba5f..dcd23d9 100644 --- a/cleanup.sh +++ b/cleanup.sh @@ -6,6 +6,6 @@ find /var/log -type f -regextype posix-extended -regex '.*\.(gz|xz|[0-9])' -dele 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=sync bs=4M; +dd if=/dev/zero of=/emptyfile oflag=sync status=progress bs=4M; rm -f /emptyfile; poweroff From 1ec3f99d303fffef892e4dbf8ed862598a311fdf Mon Sep 17 00:00:00 2001 From: Tobias Schmidl Date: Fri, 12 Apr 2019 07:47:00 +0000 Subject: [PATCH 09/12] --- cleanup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cleanup.sh b/cleanup.sh index dcd23d9..6bad121 100644 --- a/cleanup.sh +++ b/cleanup.sh @@ -6,6 +6,6 @@ find /var/log -type f -regextype posix-extended -regex '.*\.(gz|xz|[0-9])' -dele 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=sync status=progress bs=4M; +dd if=/dev/zero of=/emptyfile oflag=dsync status=progress bs=4M; rm -f /emptyfile; poweroff From f846a62eaa183713027eb04dc5eb02159da096f6 Mon Sep 17 00:00:00 2001 From: Tobias Schmidl Date: Wed, 5 Jun 2019 07:20:09 +0000 Subject: [PATCH 10/12] --- cleanup.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/cleanup.sh b/cleanup.sh index 6bad121..4ef54ce 100644 --- a/cleanup.sh +++ b/cleanup.sh @@ -1,5 +1,8 @@ #! /bin/sh +rm -rf /root/.cache /root/.rnd +find /tmp -type d -name 'systemd-*-systemd-timesyncd.service*' -delete +find /var/tmp -type d -name 'systemd-*-systemd-timesyncd.service*' -delete 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 From a7f6d84a526dd489da1609951ae98d03c3a431b2 Mon Sep 17 00:00:00 2001 From: Tobias Schmidl Date: Wed, 5 Jun 2019 07:20:59 +0000 Subject: [PATCH 11/12] --- cleanup.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cleanup.sh b/cleanup.sh index 4ef54ce..99f7fd9 100644 --- a/cleanup.sh +++ b/cleanup.sh @@ -1,8 +1,8 @@ #! /bin/sh rm -rf /root/.cache /root/.rnd -find /tmp -type d -name 'systemd-*-systemd-timesyncd.service*' -delete -find /var/tmp -type d -name 'systemd-*-systemd-timesyncd.service*' -delete +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 From b1a5f3d704dc5af9da3b3ef7c43dadcbcd1bf2fc Mon Sep 17 00:00:00 2001 From: Tobias Schmidl Date: Fri, 24 Sep 2021 11:14:38 +0200 Subject: [PATCH 12/12] --- cleanup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cleanup.sh b/cleanup.sh index 99f7fd9..d19a37f 100644 --- a/cleanup.sh +++ b/cleanup.sh @@ -11,4 +11,4 @@ truncate -s0 $HOME/.bash_history find /var/log -type f -exec truncate -s0 '{}' '+' dd if=/dev/zero of=/emptyfile oflag=dsync status=progress bs=4M; rm -f /emptyfile; -poweroff +systemctl poweroff