From 91fe4bc7c5f90a1fd692e10b5f7da9012d23d176 Mon Sep 17 00:00:00 2001 From: myvesta <38690722+myvesta@users.noreply.github.com> Date: Sun, 9 Jan 2022 14:43:45 +0100 Subject: [PATCH] Exclude /var/log/apt/* while cleaning garbage --- bin/v-clean-garbage | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/v-clean-garbage b/bin/v-clean-garbage index 1a98759d..ccee5fb5 100644 --- a/bin/v-clean-garbage +++ b/bin/v-clean-garbage @@ -7,7 +7,7 @@ rm /var/backups/* rm /var/cache/apt/archives/* cd /var/log truncate -s 0 xferlog lastlog faillog btmp syslog; -find /var/log/ -name "*.log" -type f -exec truncate -s 0 {} \; +find /var/log/ -name "*.log" -not -path "/var/log/apt/*" -type f -exec truncate -s 0 {} \; find /var/log/ -name "*.err" -type f -exec truncate -s 0 {} \; find /var/log/ -name "errors" -type f -exec truncate -s 0 {} \; find /var/log/ -name "*.info" -type f -exec truncate -s 0 {} \;