Solved

How to clean/compress /var in Linux Red Hat

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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
centos linux 65 183
bash file 10 62
Web resource - Man pages for SUSE Enterprise Linux 11 1 55
error while installing php56 in redhat enterprise linux 20 74
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…
What You Need to Know when Searching for a Webhost Provider
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…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

679 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