LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (https://www.linuxquestions.org/questions/linux-server-73/)
-   -   /var file system got FULL, How to bring the % to 70% ? (https://www.linuxquestions.org/questions/linux-server-73/var-file-system-got-full-how-to-bring-the-to-70-a-4175414159/)

redhat70 06-30-2012 09:05 AM

/var file system got FULL, How to bring the % to 70% ?
 
Hi,

One of our Linux server /var filesystem reached the threshold limit and I have to bring the % to 70 to 75% . Please help me with your commands.

/var/adm/cron and /var/adm/syslog files need to be zipped and the original file should be nullified.

How to do this ?

/dev/vg00/lvol8 4718592 3993552 719448 85% /var

I need commands to do this,Please help me.

Regards,
Aparna.

sandeep_hello 07-01-2012 12:39 AM

Hi,

You need to check the files which are consuming space in /var file system

command is

# du -Sx /var |sort -nr |head -n 10

It will give you the list of top 10 large sized files. But don't zipped them directly, there you need to check whether any OS/ any application is writing log files or not. If it is writing the logs then log rotation need to configure.

For OS logs, use below link for reference

http://linuxconfig.org/Logrotate

or for application, you need to check the application configuration.


Regards
Sandeep Sharma

lakhera2010 07-02-2012 08:41 AM

Yes Sandeep is correct.Mainly message,secure are the file which consume most of your disk space.So in case if you are facing issue with these files or too much logging is going on

/etc/logrotate.d/syslog --> by default message/secure are mentioned

/var/log/messages /var/log/secure /var/log/maillog /var/log/spooler /var/log/boot.log /var/log/cron {
sharedscripts
postrotate
/bin/kill -HUP `cat /var/run/syslogd.pid 2> /dev/null` 2> /dev/null || true
endscript
}

Also you can tweak the parameter how soon you want to rotate your logs

cat /etc/logrotate.conf
# see "man logrotate" for details
# rotate log files weekly
weekly

# keep 4 weeks worth of backlogs
rotate 4

But its completly dependent on your env and there might be other apps which are filling /var.So please take the output of du -sh *|grep G and see what is causing that...


All times are GMT -5. The time now is 07:29 PM.