0

I noticed that my disk in my Linux ubuntu server is already full and one that's causing it is inside my /var/log folder.

I have these files inside my /var/log:

enter image description here

I don't know what files are these, but are these safe to delete?

There's a bunch of alternatives.log.x and other .gz files. Can i delete those?

Thanks.

8
  • 5
    You're trying to fix the symptom of a problem, rather than the real issue. The logs will fill again, so why not look at what's in the logs first to see what's filling your logs.
    – guiverc
    May 17, 2020 at 1:13
  • 1
    yup, I agree with that and I can do that later but is it safe to delete these files? May 17, 2020 at 1:14
  • Can you at least post samples (add to your question, please) of the current logs that are causing the most problems? May 17, 2020 at 1:16
  • You're not listening to @guiverc advice. Figure out which log is taking up the space, then review the log to find out what's filling the log, then fix that first. In terminal type cd /var/log then ls -alS and look at the first 1-5 lines of output to see the top file sizes. Then tail filename. So NO, don't delete anything.
    – heynnema
    May 17, 2020 at 13:31
  • 1
    Agree that you need to figure out what is going on to create such big logs in the first place. Disagree that you shouldn't delete something in the meantime. If your disk is full, then the priority is to make a bit of room, then investigate. Delete the oldest files first. if this is a server, some services might no longer work properly (I recently filled by server disk by accident, and only noticed days later that a service (DHCPD) was no longer working properly). The answer to your question is, yes. May 17, 2020 at 14:31

0

Browse other questions tagged .