Var/log file way too large

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
newbie1010
Level 3
Level 3
Posts: 110
Joined: Thu Dec 31, 2015 10:54 am

Var/log file way too large

Post by newbie1010 »

I've had this problem for a couple of months now since I installed linux mint rosa. My Var/log file keeps increasing. I increased my dual boot partition space to deal with it but is still taking up way too much space. How do I put a stop to this.
deepakdeshp
Level 18
Level 18
Posts: 8991
Joined: Sun Aug 09, 2015 10:00 am

Re: Var/log file way too large

Post by deepakdeshp »

If I have helped you solve a problem, please add [SOLVED] to your first post title, it helps other users looking for help, and keeps the forum clean.
Regards,
Deepak

Mint 20.1 Cinnamon 64 bit with AMD A8/7410 / 8GB
Mint 20.1 Cinnamon AMD Ryzen3500U/8gb
newbie1010
Level 3
Level 3
Posts: 110
Joined: Thu Dec 31, 2015 10:54 am

Re: Var/log file way too large

Post by newbie1010 »

I tried it but nothing seems to have changed
deepakdeshp
Level 18
Level 18
Posts: 8991
Joined: Sun Aug 09, 2015 10:00 am

Re: Var/log file way too large

Post by deepakdeshp »

After investigation did you run

Code: Select all

sudo /usr/sbin/logrotate -fv /etc/logrotate.conf
It should trim the logs. Which log folders are huge? The thread explains it.
If I have helped you solve a problem, please add [SOLVED] to your first post title, it helps other users looking for help, and keeps the forum clean.
Regards,
Deepak

Mint 20.1 Cinnamon 64 bit with AMD A8/7410 / 8GB
Mint 20.1 Cinnamon AMD Ryzen3500U/8gb
deepakdeshp
Level 18
Level 18
Posts: 8991
Joined: Sun Aug 09, 2015 10:00 am

Re: Var/log file way too large

Post by deepakdeshp »

After investigation did you run

Code: Select all

sudo /usr/sbin/logrotate -fv /etc/logrotate.conf
It should trim the logs. Which log folders are huge? The thread explains it. Please copy paste command in terminal.
If I have helped you solve a problem, please add [SOLVED] to your first post title, it helps other users looking for help, and keeps the forum clean.
Regards,
Deepak

Mint 20.1 Cinnamon 64 bit with AMD A8/7410 / 8GB
Mint 20.1 Cinnamon AMD Ryzen3500U/8gb
newbie1010
Level 3
Level 3
Posts: 110
Joined: Thu Dec 31, 2015 10:54 am

Re: Var/log file way too large

Post by newbie1010 »

deepakdeshp wrote:After investigation did you run

Code: Select all

sudo /usr/sbin/logrotate -fv /etc/logrotate.conf
It should trim the logs. Which log folders are huge? The thread explains it. Please copy paste command in terminal.
http://imgur.com/a/Jn2S7 these are the same files
deepakdeshp
Level 18
Level 18
Posts: 8991
Joined: Sun Aug 09, 2015 10:00 am

Re: Var/log file way too large

Post by deepakdeshp »

You should run the commands in a terminal.
If I have helped you solve a problem, please add [SOLVED] to your first post title, it helps other users looking for help, and keeps the forum clean.
Regards,
Deepak

Mint 20.1 Cinnamon 64 bit with AMD A8/7410 / 8GB
Mint 20.1 Cinnamon AMD Ryzen3500U/8gb
User avatar
Pjotr
Level 22
Level 22
Posts: 16161
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland)
Contact:

Re: Var/log file way too large

Post by Pjotr »

Tip: 10 things to do after installing Linux Mint 20.1 Ulyssa
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
newbie1010
Level 3
Level 3
Posts: 110
Joined: Thu Dec 31, 2015 10:54 am

Re: Var/log file way too large

Post by newbie1010 »

deepakdeshp wrote:You should run the commands in a terminal.
I ave run them in the terminal
newbie1010
Level 3
Level 3
Posts: 110
Joined: Thu Dec 31, 2015 10:54 am

Re: Var/log file way too large

Post by newbie1010 »

Pjotr wrote:Try this:
https://sites.google.com/site/easylinux ... ut-of-hand
(item 16, right column)
This doesn't work on my computer it says there isn't a file on my computer called disk eater
User avatar
Pjotr
Level 22
Level 22
Posts: 16161
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland)
Contact:

Re: Var/log file way too large

Post by Pjotr »

newbie1010 wrote:
Pjotr wrote:Try this:
https://sites.google.com/site/easylinux ... ut-of-hand
(item 16, right column)
This doesn't work on my computer it says there isn't a file on my computer called disk eater
Skip the creation of that diagnostic log file and head straight to this:

Code: Select all

gksudo xed /etc/logrotate.d/rsyslog
Delete the entire content of that text file and replace it by the text below (use copy/paste):

Code: Select all

/var/log/syslog
{
      rotate 1
      maxsize 10M
      hourly
      missingok
      notifempty
      delaycompress
      compress
      postrotate
           reload rsyslog >/dev/null 2>&1 || true
      endscript
}

/var/log/mail.info
/var/log/mail.warn
/var/log/mail.err
/var/log/mail.log
/var/log/daemon.log
/var/log/kern.log
/var/log/auth.log
/var/log/user.log
/var/log/lpr.log
/var/log/cron.log
/var/log/debug
/var/log/messages
{
      rotate 1
      maxsize 10M
      hourly
      missingok
      notifempty
      compress
      delaycompress
      sharedscripts
      postrotate
           reload rsyslog >/dev/null 2>&1 || true
      endscript
}
Save the modified text file and close it. This limits the size of each log to 10 megabytes, and the number of old copies to 1. Logrotate will now be executed every hour.

Reboot your computer.
Tip: 10 things to do after installing Linux Mint 20.1 Ulyssa
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
newbie1010
Level 3
Level 3
Posts: 110
Joined: Thu Dec 31, 2015 10:54 am

Re: Var/log file way too large

Post by newbie1010 »

I don't think it worked it says this http://imgur.com/a/srVbh
User avatar
Pjotr
Level 22
Level 22
Posts: 16161
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland)
Contact:

Re: Var/log file way too large

Post by Pjotr »

OK, I missed the fact that you're still on Rosa. Which means you don't have xed.

Install Leafpad:

Code: Select all

sudo apt-get install leafpad
Then use it to edit rsyslog:

Code: Select all

gksudo leafpad /etc/logrotate.d/rsyslog
.... for the rest, see my previous message.
Tip: 10 things to do after installing Linux Mint 20.1 Ulyssa
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
newbie1010
Level 3
Level 3
Posts: 110
Joined: Thu Dec 31, 2015 10:54 am

Re: Var/log file way too large

Post by newbie1010 »

done it
User avatar
Pjotr
Level 22
Level 22
Posts: 16161
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland)
Contact:

Re: Var/log file way too large

Post by Pjotr »

newbie1010 wrote:done it
Good! Did it help, after you've rebooted?
Tip: 10 things to do after installing Linux Mint 20.1 Ulyssa
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
newbie1010
Level 3
Level 3
Posts: 110
Joined: Thu Dec 31, 2015 10:54 am

Re: Var/log file way too large

Post by newbie1010 »

Pjotr wrote:
newbie1010 wrote:done it
Good! Did it help, after you've rebooted?
well i'm not sure yet because the older error files haven't been deleted so I'm still getting messages saying I only have 2 GB left in a 200GB partition
User avatar
Pjotr
Level 22
Level 22
Posts: 16161
Joined: Mon Mar 07, 2011 10:18 am
Location: The Netherlands (Holland)
Contact:

Re: Var/log file way too large

Post by Pjotr »

Execute this terminal command:

Code: Select all

sudo logrotate -fv /etc/logrotate.conf
Note that this can take a very long time! The terminal may seem "stuck", but it's not. Just wait until the job has been finished, even if it takes half an hour.
Tip: 10 things to do after installing Linux Mint 20.1 Ulyssa
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
newbie1010
Level 3
Level 3
Posts: 110
Joined: Thu Dec 31, 2015 10:54 am

Re: Var/log file way too large

Post by newbie1010 »

done it should I check the disk space again now?
deepakdeshp
Level 18
Level 18
Posts: 8991
Joined: Sun Aug 09, 2015 10:00 am

Re: Var/log file way too large

Post by deepakdeshp »

newbie1010 wrote:done it should I check the disk space again now?
Yes
If I have helped you solve a problem, please add [SOLVED] to your first post title, it helps other users looking for help, and keeps the forum clean.
Regards,
Deepak

Mint 20.1 Cinnamon 64 bit with AMD A8/7410 / 8GB
Mint 20.1 Cinnamon AMD Ryzen3500U/8gb
newbie1010
Level 3
Level 3
Posts: 110
Joined: Thu Dec 31, 2015 10:54 am

Re: Var/log file way too large

Post by newbie1010 »

the available disk space has increased from 2GB to 11.5 GB but the var/log file is still using up 169 GB
Post Reply

Return to “Newbie Questions”