How to safely delete Linux System Logs

preview_player
Показать описание
Managing logfiles is a bit weirder in systemd/journalctl. Here's how to safely clean up old logfiles in Linux.

journalctl --vacuum-time=2d
journalctl --vacuum-size=100M

Рекомендации по теме
Комментарии
Автор

I was afraid my virtual box was going to explode, thanks my man.

staufackar
Автор

Hi maybe you have a video about troubleshooting in linux webserver ?

samrybkin
Автор

--vacuum-size= will not always free up space as requested because it won't look into recent logs.

--vacuum-size= removes the OLDEST ARCHIVED journal files until the disk space they use falls below the specified size (specified with the usual "K", "M", "G" and "T" suffixes), or ALL ARCHIVED journal files contain no data older than the specified timespan (specified with the usual "s", "m", "h", "days", "months", "weeks" and "years" suffixes).

quirklyquibble
Автор

very nice! thanks. Had 968M after only 3 months.

MrWARRIORMONKS
Автор

Coincidence, I just cleaned my logs 5 days ago before this video and I had something like 6GB of logs

GooogleGoglee
Автор

Is it bad if i just 'sudo rm /var/log' ?

usesap
Автор

Thanks! I had 3.5G of logs on a tiny 50G partition :(

ApurvJyotirmay
Автор

My problem is it's the "syslog" spitting out hundreds of gigabytes of garbage data, none of the parsing or vaccum tricks seem to work there.

budthecyborg
Автор

my syslog is 200GB and i installed ubuntu 2 days ago. how could this happen?

Luka-qmri
Автор

Can you provide the commands you ran in the description please...or a link to what you are running?

haydenc
Автор

this is great bur this can use only for journal logs not all system logs

eisamohammadzadeh
Автор

holy crap - I have 4.1G worth of logfiles on my system

paulg
Автор

Journal needs a cuddle. System(d) needs a cuddle. Sys(tem) needs a cuddle. Network needs a cuddle. ALSA needs a cuddle. Pulse Audio needs two cuddles. Home needs a cuddle. Locale needs a cuddle. CUPS needs a cuddle...
We all need a cuddle. <3

nibblrrr
Автор

I'm not saying cuddle or cuttle . It's dumb sounding.

Clobercow