summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xclean-logs.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/clean-logs.sh b/clean-logs.sh
index 545fe1c..96316d6 100755
--- a/clean-logs.sh
+++ b/clean-logs.sh
@@ -1,5 +1,11 @@
#!/bin/bash
+#
+# ToDo
+# truncate -s 0 /var/log/syslog
+# /var/log/journal/f* (new in 18.10)
+#
+
# clean traditional logs etc.
find /var/log/ -type f -name "*.gz" -exec rm -f {} \;
find /var/log/ -type f -name "*.1" -exec rm -f {} \;
@@ -10,7 +16,8 @@ if [[ -d /var/log/journal || -d /run/log/journal/ ]]; then
systemctl stop systemd-journald
journal_dirs1=$(find /var/log/journal/ -maxdepth 1 -type d -name "a*")
journal_dirs2=$(find /run/log/journal/ -maxdepth 1 -type d -name "f*")
- journal_dirs="$journal_dirs1 $journal_dirs2";
+ journal_dirs3=$(find /run/log/journal/ -maxdepth 1 -type d -name "[0-9]*")
+ journal_dirs="$journal_dirs1 $journal_dirs2 $journal_dirs3";
for j in $journal_dirs; do
echo "removing ${j}"