Labels

hpunix (63) marathi kavita (52) linux (21) solaris11 (10) AWS (5) numerology (5)

Wednesday, December 16, 2020

Can I delete files in /var/log/journal ?

Can I delete files in /var/log/journal ?


/var/log/journal/ are kept the log files created by the journal service (systemd). Yes, the files from /var/log/journal directory can be removed.


1. If /var/log/journal log file using more space like 3.5G etc.. 

We can verify it by running below command:

# journalctl --disk-usage


2. Note down the SystemMaxUse value, it could be hashed or having value like 3.5G

#cat /etc/systemd/journald.conf |grep -i SystemMaxUse


3. Before editing journald.conf file; take copy of it

#cp -rp /etc/systemd/journald.conf /etc/systemd/journald.conf_backup


4. Edit the file journald.conf using vi editor and change the value SystemMaxUse to 200 or 300MB

#cat /etc/systemd/journald.conf |grep -i SystemMaxUse

SystemMaxUse=300M


5. Restart the systemd-journald service to make the changes effective done in /etc/systemd/journald.conf

#systemctl restart systemd-journald


Or


If you do not want to restart the systemd-journald service then use below command :

#journalctl –vacuum-size=300M 



Thanks,

Kiraan B Jadhav

No comments:

Post a Comment