Solved

How to clean/compress /var in Linux Red Hat

Posted on 2014-11-23
5
350 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
5 Comments
 
LVL 11

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 11

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

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Periodically we have to update or add SSL certificates for customers. Depending upon your hosting plan you may be responsible for the installation and/or key generation. In the wake of Heartbleed many sites were forced to re-key. We will concen…
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 get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
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.:

705 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now