GoWilkes

Well-Known Member
Sep 26, 2006
692
33
178
cPanel Access Level
Root Administrator
My /usr/ directory keeps getting above 90%, but the regular log directories don't seem all that large to me. According to du, here are my directory sizes:

/domlogs/ = 232MB
/logs/ = 16MB

The partition is 7.75G, so 248MB in logs doesn't seem like a very large percentage.

I know that I can move /domlogs/ to /home/ and set up a symlink, but I really don't want to waste space on /home/ if I don't have to. I've never actually looked at /domlogs/ for anything relevant; can this directory just be killed? If so, how?

Also, I see /usr/local/apache.backup/ and /usr/local/apache.backup_archive/. These aren't huge (36M and 8k, respectively), but am I correct in understanding that they can be removed entirely?

What else can I do to permanently free up space?
 

MikeDVB

Well-Known Member
PartnerNOC
Jun 4, 2008
220
6
68
Indiana, USA
Code:
du | sort -n | awk '{if($1>50) printf("%s     %s\n",$1,$2);}'
Run that from within /usr and it will give you an idea of where all of your usage is.
 

GoWilkes

Well-Known Member
Sep 26, 2006
692
33
178
cPanel Access Level
Root Administrator
Am I right in understanding that this sorts with the largest files at the bottom? If so, here are the last ones listed from /usr/:

Code:
202936     ./local/cpanel/modules-install/clamavconnector-Linux-x86_64/clamav-0.97.8
216992     ./bin
217436     ./local/cpanel/modules-install/clamavconnector-Linux-x86_64
217532     ./local/cpanel/modules-install
219608     ./share/doc
332472     ./local/cpanel/whostmgr/bin
360764     ./local/cpanel/src/3rdparty/gpl
366568     ./local/apache/domlogs
368080     ./local/cpanel/whostmgr
375628     ./lib
400616     ./local/cpanel/3rdparty
408512     ./local/cpanel/src/3rdparty
412552     ./local/cpanel/src
424772     ./local/apache
463460     ./local/cpanel/bin
490336     ./local/cpanel/base
494616     ./lib64
1137816     ./share
2622332     ./local/cpanel
3163508     ./local
5799680     .

The big directory is /usr/local, and when I go there I get:

Code:
178832     ./cpanel/base/frontend
187028     ./cpanel/bin/admin/Cpanel
187032     ./cpanel/bin/admin
187964     ./cpanel/3rdparty/perl/514/lib64/perl5
187968     ./cpanel/3rdparty/perl/514/lib64
190332     ./cpanel/3rdparty/perl/514
190336     ./cpanel/3rdparty/perl
202936     ./cpanel/modules-install/clamavconnector-Linux-x86_64/clamav-0.97.8
217436     ./cpanel/modules-install/clamavconnector-Linux-x86_64
217532     ./cpanel/modules-install
332472     ./cpanel/whostmgr/bin
360764     ./cpanel/src/3rdparty/gpl
368064     ./cpanel/whostmgr
370308     ./apache/domlogs
400616     ./cpanel/3rdparty
408512     ./cpanel/src/3rdparty
412552     ./cpanel/src
428564     ./apache
463460     ./cpanel/bin
490336     ./cpanel/base
2622316     ./cpanel
3167284     .
Those are just the last screen, of course; I didn't want to paste the whole list filled with small files. But none of these seem particularly large, do they?
 

GoWilkes

Well-Known Member
Sep 26, 2006
692
33
178
cPanel Access Level
Root Administrator
Even though /domlogs/ isn't really the problem, it's the only larger files that I know I can deal with. I'm guessing there's really nothing under /usr/local/cpanel that I can delete.

If I want to move /domlog/ to /home/, can someone confirm this is correct before I run it?

mv /usr/local/apache/domlogs /home/domlogs (do I need to create /home/domlogs first?)

cd /usr/local/apache
ln -s /home/domlogs domlogs
 

GoWilkes

Well-Known Member
Sep 26, 2006
692
33
178
cPanel Access Level
Root Administrator
Since no one replied, I threw a dart at the board and just pasted what I had (my /usr/ was at 100%, so I didn't have much of a choice).

For anyone reading this, know that something's wrong with the "mv" command. I created /home/domlogs/, then when I ran:

mv /usr/local/apache/domlogs /home/domlogs

it created /home/domlogs/domlogs/. I tried running this to move everything up a directory:

mv /home/domlogs/domlogs ..

and now all of the log files are gone.

After that, though, the next two commands seemed to work correctly:

cd /usr/local/apache
ln -s /home/domlogs domlogs
 

quietFinn

Well-Known Member
Feb 4, 2006
1,894
463
438
Finland
cPanel Access Level
Root Administrator
mv /home/domlogs/domlogs ..

and now all of the log files are gone.
In what directory were you when you did that?
Because you moved everything one step up from the "currecnt working directory".
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,260
463
Hello :)

If you need to complete this action again in the future, you could simply run the following commands:

Code:
cd /usr/local/apache
mv domlogs /home/domlogs
ln -s /home/domlogs domlogs
/scripts/restartsrv_httpd
Thank you.
 

GoWilkes

Well-Known Member
Sep 26, 2006
692
33
178
cPanel Access Level
Root Administrator
In what directory were you when you did that?
Because you moved everything one step up from the "currecnt working directory".
Ahh, didn't think about that! I was in /usr/local/apache/, and you're right, they're now in /usr/local/domlogs/.

I guess they've all been recreated now, though, so all I can really do is delete these.