LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 08-14-2023, 01:27 AM   #1
Jason.nix
Member
 
Registered: Feb 2023
Posts: 562

Rep: Reputation: 10
Post How to clear journalctl log?


Hello,
How can I remove all the journalctl logs? I used journalctl --vacuum-time=1s command, but logs exist.


Thank you.
 
Old 08-14-2023, 01:36 AM   #2
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 5,819
Blog Entries: 1

Rep: Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068
The persistent logs are found in the subdirectory contained in /var/log/journal/. You can delete them, but some current portion, up to 100%, remains in memory until flushed to disk and/or shutting down or rebooting.
 
1 members found this post helpful.
Old 08-14-2023, 02:13 AM   #3
pan64
LQ Addict
 
Registered: Mar 2012
Location: Hungary
Distribution: debian/ubuntu/suse ...
Posts: 21,899

Rep: Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318Reputation: 7318
why do you want to remove them? By the way it is continuously written.
 
Old 08-14-2023, 04:53 AM   #4
hazel
LQ Guru
 
Registered: Mar 2016
Location: Harrow, UK
Distribution: LFS, AntiX, Slackware
Posts: 7,597
Blog Entries: 19

Rep: Reputation: 4455Reputation: 4455Reputation: 4455Reputation: 4455Reputation: 4455Reputation: 4455Reputation: 4455Reputation: 4455Reputation: 4455Reputation: 4455Reputation: 4455
Set up a weekly logrotate job to clear the file and store as many old versions as you want to keep.
https://linuxconfig.org/logrotate
 
1 members found this post helpful.
Old 08-14-2023, 05:01 AM   #5
Jason.nix
Member
 
Registered: Feb 2023
Posts: 562

Original Poster
Rep: Reputation: 10
Quote:
Originally Posted by mrmazda View Post
The persistent logs are found in the subdirectory contained in /var/log/journal/. You can delete them, but some current portion, up to 100%, remains in memory until flushed to disk and/or shutting down or rebooting.
Hello,
Thank you so much for your reply.
Problem solved.
 
Old 08-14-2023, 12:40 PM   #6
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 5,819
Blog Entries: 1

Rep: Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068
What was the problem that was solved? The persistent journal is optional, and configured via /etc/systemd/journald.conf.
 
Old 08-15-2023, 05:51 AM   #7
Jason.nix
Member
 
Registered: Feb 2023
Posts: 562

Original Poster
Rep: Reputation: 10
Quote:
Originally Posted by mrmazda View Post
What was the problem that was solved? The persistent journal is optional, and configured via /etc/systemd/journald.conf.
Hello,
I removed all files under the /var/log/journal/ directory.
 
Old 08-15-2023, 06:20 AM   #8
mrmazda
LQ Guru
 
Registered: Aug 2016
Location: SE USA
Distribution: openSUSE 24/7; Debian, Knoppix, Mageia, Fedora, others
Posts: 5,819
Blog Entries: 1

Rep: Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068Reputation: 2068
That was your solution. What was the problem that necessitated removing log files?
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] learning to debug using journalctl - setting up marker on journal log andrewysk Linux - Newbie 2 09-19-2021 03:27 PM
[SOLVED] cant fix: "CLEAR: command not found" when trying to execute in terminal. "CLEAR" is part of code not the command to wipe the terminal screen Kintaro Linux - Newbie 12 08-03-2020 04:27 PM
clear is hashed (/user/bin/clear) What does it mean? mohammed.hossain Linux - Newbie 1 10-24-2010 07:53 PM
How to clear a std::string buff.clear()? lucky6969b Programming 3 03-17-2006 07:50 AM
how do i replace the clear "clear screen" with the cls command thefedexguy SUSE / openSUSE 2 12-02-2005 05:02 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 02:51 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration