Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

How to clean/compress /var in Linux Red Hat

Posted on 2014-11-23
5
Medium Priority
?
397 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 498 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 501 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 501 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

Tutorials alone can't teach real engineering

So we built better training tools.

-Hands-on Labs
-Instructor Mentoring
-Scenario-Based Tests
-Dedicated Cloud Servers

All at your fingertips. What are you waiting for?

Question has a verified solution.

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

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
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

715 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