You are not logged in.

#1 2012-12-31 06:41:42

eshizhan
Member
Registered: 2012-03-26
Posts: 25

[SOLVED]How to clean old log by journalctl

I set SystemMaxUse=50M and reboot, but no effect.

Last edited by eshizhan (2013-01-02 02:55:50)

Offline

#2 2012-12-31 09:45:55

berbae
Member
From: France
Registered: 2007-02-12
Posts: 1,302

Re: [SOLVED]How to clean old log by journalctl

There is already a thread about that: https://bbs.archlinux.org/viewtopic.php?id=150052

One possible cause is that the systemd-journald service is not cleanly stopped at shutdown, which causes the creation of a .journal~ file in /var/log/journal/.../ directory and prevent a cleanup of old rotated files if it happens to the last system.journal file.
So if you have such .journal~ files from the last reboot, that is your problem.

I solved that by adding the shutdown hook in the initramfs generated by mkinitcpio.
And I use only a non default value for the SystemMaxUse parameter; all other parameters are kept in default state.

Edit: I forgot I have also 'ForwardToSyslog=no' which is not default.

Note also that the real disk usage will grow to SystemMaxUse + SystemMaxUse/8

Personally I use 'SystemMaxUse=16M' which is largely enough as the daily log file size is ~1.2M.

And the cleanup works as expected.

Last edited by berbae (2013-01-02 09:21:36)

Offline

#3 2013-01-02 02:55:33

eshizhan
Member
Registered: 2012-03-26
Posts: 25

Re: [SOLVED]How to clean old log by journalctl

Thx, berbae.

Offline

Board footer

Powered by FluxBB