How to safely delete Linux System Logs

Sdílet
Vložit
  • čas přidán 29. 08. 2024
  • 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
    devopsintervie...
    Free Linux Sysadmin Course Playlist: • The Linux Basics Cours...
    Check out my step-by-step project-based Linux course for beginners, 93% off when you use this link: www.udemy.com/...
    Patreon: / tutorialinux
    Official Site & e-mail list: tutorialinux.com/
    Twitter: / tutorialinux
    Facebook: / tutorialinux
    Podcast: kernelpanicpodc...

Komentáře • 33

  • @staufackar2135
    @staufackar2135 Před 2 měsíci

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

  • @GooogleGoglee
    @GooogleGoglee Před 3 lety +6

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

    • @GooogleGoglee
      @GooogleGoglee Před 3 lety

      @Owen Cory I think you wanted to leave this comment to another video

  • @quirklyquibble
    @quirklyquibble Před rokem

    --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).

  • @mikerollin4073
    @mikerollin4073 Před rokem

    Thanks

  • @ApurvJyotirmay
    @ApurvJyotirmay Před 3 lety +2

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

  • @MrWARRIORMONKS
    @MrWARRIORMONKS Před 3 lety +1

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

  • @comosaycomosah
    @comosaycomosah Před 6 měsíci

    your channel is really good my dude!

  • @budthecyborg4575
    @budthecyborg4575 Před 3 lety +1

    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.

  • @Luka-qm1ri
    @Luka-qm1ri Před 3 měsíci

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

  • @eisamohammadzadeh105
    @eisamohammadzadeh105 Před 3 lety +1

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

    • @tutoriaLinux
      @tutoriaLinux  Před 3 lety +3

      That's true, if you have applications that are writing plaintext logfiles outside the systemd journal you'll want to set up logrotate configs to manage them.

  • @user-xy5qj2ts9k
    @user-xy5qj2ts9k Před 3 lety

    Thank you, sir.

  • @jimkats1
    @jimkats1 Před 3 lety

    Really nice

  • @uses0ap
    @uses0ap Před 3 lety

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

  • @samrybkin9184
    @samrybkin9184 Před 3 lety

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

  • @nibblrrr7124
    @nibblrrr7124 Před 3 lety +6

    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.

  • @haydenc2742
    @haydenc2742 Před 3 lety

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

  • @SkyFly19853
    @SkyFly19853 Před 3 lety +1

    Can it be done by Bleachbit?

    • @GooogleGoglee
      @GooogleGoglee Před 3 lety

      Mmm... Niii
      I would say use it just for the cache, don't trust too much that software
      After all are just a few commands, use journalctl for this particular task about system logs

    • @SkyFly19853
      @SkyFly19853 Před 3 lety

      @@GooogleGoglee
      I see...

  • @yarutsai4607
    @yarutsai4607 Před 3 lety

    I like sudo !!.

  • @paulg3336
    @paulg3336 Před 3 lety

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

  • @EndrChe
    @EndrChe Před 3 lety

    Systemd bitterness is bitter.

  • @bin4rym4ge
    @bin4rym4ge Před 2 lety

    4GB of logs lol

  • @Clobercow1
    @Clobercow1 Před 3 lety +1

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

  • @takedownccp
    @takedownccp Před 5 měsíci

    rotate it