Discussion:
Using - journalctl -
(too old to reply)
Charles Curley
2024-08-28 22:20:01 UTC
Permalink
On Wed, 28 Aug 2024 11:47:48 -0400
Having said that, I would like to keep my 'events' log showing only
the last two days; as explain here
<https://unix.stackexchange.com/questions/139513/how-to-clear-journalctl>,
using the following command : *journalctl --vacuum-time=2d*. However,
when I use the 'journal' command to see the log record, it shows
dates as back as January-2021. Just for the record, we are in
August-2024.
I'm no expert on systemd, nor have I played one on television. However…

Rather than do this manually, take a look at the second answer,
starting "You don't typically clear the journal yourself."
What am I doing wrong?
Are you doing this as root?

If you watch the journal in one terminal (run "journalctl -f" as root),
and run that command in another, do you see any interesting entries? If
so, please copy and paste them into your reply.

On Monday I installed trixie on a virtual machine so I could play
with it. Running that command on that machine, I saw the following
output (which your email program may mangle):

***@testing:/media/disk# journalctl --vacuum-time=2d
Vacuuming done, freed 0B of archived journals from /var/log/journal/7ed347a1b9484dae91ba8c621e621d5d.
Vacuuming done, freed 0B of archived journals from /var/log/journal.
Vacuuming done, freed 0B of archived journals from /run/log/journal.
***@testing:/media/disk#

Do you see any such output?
--
Does anybody read signatures any more?

https://charlescurley.com
https://charlescurley.com/blog/
Nicolas George
2024-08-28 22:40:01 UTC
Permalink
Having said that, I would like to keep my 'events' log showing only the last
two days; as explain here
<https://unix.stackexchange.com/questions/139513/how-to-clear-journalctl>,
using the following command : *journalctl --vacuum-time=2d*. However, when I
use the 'journal' command to see the log record, it shows dates as back as
January-2021. Just for the record, we are in August-2024.
What am I doing wrong?
# --vacuum-time= removes archived journal files older than the

I notice the *archived* word. Maybe your journal since January is not
archived.

You should look at the size and timestamps of the files in
/var/log/journal/.

Maybe also try to run “journalctl --rotate” before or after “journalctl
--vacuum-time=2d”, to have a point to discard the next time.

Regards,
--
Nicolas George
Loading...