Solved

How to clean/compress /var in Linux Red Hat

Posted on 2014-11-23
5
379 Views
Last Modified: 2014-12-05
I have a Linux Red Hat v6 server and noticed that /var is 100% full. The server starts but the web application is not loading. Can this be related to the full directory and what is the best way to clean or resize the directory?

Thanks in advance
0
Comment
Question by:exhuser
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 12

Expert Comment

by:andreas
ID: 40460973
run a df -k|sort -n and you see which folders in /var use most space.

Be aware that some contant in /var is critical for system operation. So dont delete things there until you know its safe to delete this content.

If your system still has unallocated space ynd you have a LVM setup you might enlarge /var by adding unallocated space to it.
0
 
LVL 48

Assisted Solution

by:Tintin
Tintin earned 166 total points
ID: 40460979
Adding more space depends on whether you have more physical disk space and are using Logical Volume Manager (LVM).

Easiest course of action is to delete old files in /var/log

You can list old files with

find /var -type f -mtime +30 -ls

That will list any files in /var older that 30 days.
0
 

Author Comment

by:exhuser
ID: 40461023
Most space:
1. Logs
2. Cache
3. Crash

Which ones can be safely deleted?
0
 
LVL 11

Accepted Solution

by:
legolasthehansy earned 167 total points
ID: 40461054
The safest to remove is the crash logs but only after you have determined what program dumped them in the /var and fixed it. They contain valuable information on program being terminated abruptly.
0
 
LVL 12

Assisted Solution

by:andreas
andreas earned 167 total points
ID: 40461456
In /var/log you might safely remove all files that and with -datestamp (e.g. (messages-20141123, or cron-20140813))
This are backed up old log files.

In /var/cache are sometimes things that shouldn't be deleted so I would let this alone for now.

contents of /var/crash can be deleted if nobody want that information for error fixing anymore.
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Linux users are sometimes dumbfounded by the severe lack of documentation on a topic. Sometimes, the documentation is copious, but other times, you end up with some obscure "it varies depending on your distribution" over and over when searching for …
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question