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
Solved

How to clean/compress /var in Linux Red Hat

Posted on 2014-11-23
5
369 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
LINUX backups with VEEAM 8 117
number in printf 13 32
What is the best way to transfer files from and to Linux VNC window? 9 49
The better OS Architecture 13 63
Fine Tune your automatic Updates for Ubuntu / Debian
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…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

792 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