0

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!

0

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.

0

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

  • same result; root@nyc3-x8:/var/log# journalctl --vacuum-time 1d journalctl: unrecognized option '--vacuum-time' – Goktug Oct 10 '18 at 18:33
  • Did you try this? unix.stackexchange.com/a/184348/280841 – Amin Vakil Oct 10 '18 at 18:36
  • Yes, nothing has changed. – Goktug Oct 10 '18 at 18:41
  • Interesting. The above command works for me. Maybe it's about different versions of journalctl? – mc0e Apr 15 at 4:47

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.