2

I want to clear my "/var/log/journal" directory.

I'm using debian 8

root@nyc3-x8:/var/log# uname -a
Linux nyc3-x8 3.16.0-4-amd64 #1 SMP Debian 3.16.36-1+deb8u2 (2016-10-19) x86_64 GNU/Linux

And my journal;

root@nyc3-x8:/var/log# du -hs journal/
11G journal/

I searched the forum and tried "journalctl --vacuum-time = xd" but it didn't work;

root@nyc3-x8:/var/log# journalctl --vacuum-time=1d
journalctl: unrecognized option '--vacuum-time=1d'

What should i do?

Thanks!

Goktug
  • 23
  • 1
  • 3

2 Answers2

1

You can modify /etc/systemd/journald.conf to make the retention time shorter or limit the file size.

MaxRetentionSec= can specify the time to keep logs in seconds. You can override the default unit of time by using a value like "1month" or "1y"

SystemMaxUse= accepts percentage values, and defaults to 10%.

If changing these options and restarting don't make a difference (apparently corrupted logs will never be deleted), you can safely delete anything in the /var/log/journal directory with rm, just don't delete the directory itself.

sippybear
  • 3,197
  • 1
  • 13
  • 12
0

It should be journalctl --vacuum-time 1d.

Amin Vakil
  • 27
  • 7