Exclude /var/log/apt/* while cleaning garbage

This commit is contained in:
myvesta 2022-01-09 14:43:45 +01:00 committed by GitHub
commit 91fe4bc7c5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -7,7 +7,7 @@ rm /var/backups/*
rm /var/cache/apt/archives/* rm /var/cache/apt/archives/*
cd /var/log cd /var/log
truncate -s 0 xferlog lastlog faillog btmp syslog; 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 "*.err" -type f -exec truncate -s 0 {} \;
find /var/log/ -name "errors" -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 {} \; find /var/log/ -name "*.info" -type f -exec truncate -s 0 {} \;