summaryrefslogtreecommitdiffstats
path: root/clean-logs.sh
diff options
context:
space:
mode:
Diffstat (limited to 'clean-logs.sh')
-rwxr-xr-xclean-logs.sh8
1 files changed, 6 insertions, 2 deletions
diff --git a/clean-logs.sh b/clean-logs.sh
index 0ea4956..545fe1c 100755
--- a/clean-logs.sh
+++ b/clean-logs.sh
@@ -6,9 +6,12 @@ find /var/log/ -type f -name "*.1" -exec rm -f {} \;
find /var/log/ -type f -name "*.old" -exec rm -f {} \;
# clean systemd's journal
-if [[ -d /var/log/journal ]]; then
+if [[ -d /var/log/journal || -d /run/log/journal/ ]]; then
systemctl stop systemd-journald
- journal_dirs=$(find /var/log/journal/ -maxdepth 1 -type d -name "a*")
+ 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";
+
for j in $journal_dirs; do
echo "removing ${j}"
rm -rf $j
@@ -32,3 +35,4 @@ fi
find /var/log/ -name "*.log" -exec truncate -s 0 {} \;
exit 0
+