/usr directory keeps filling up.

jols

Well-Known Member
Mar 13, 2004
1,110
3
168
We've got the /usr directory getting very close to 90% full on about half of our servers, even our newest server, just put on line a couple of weeks ago has /usr at 84%.

Anyone have any idea how to keep this one from getting so full?

Thanks in advance for any help with this.
 

rahulm

Member
Jan 19, 2006
9
0
151
Hello,

/usr contain apache logs in directory /usr/local/apache/logs/ you have to check log files size. You can empty the file by running following command.

echo > error_log

/usr partition also contain domlogs of every domain. It uses the more disk space. You can move /usr/local/apache/domlogs directory to /home/


Regards,
Rahul Mudavadkar
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,216
12
313
Houston, TX
cPanel Access Level
Root Administrator
Hello,

/usr contain apache logs in directory /usr/local/apache/logs/ you have to check log files size. You can empty the file by running following command.

echo > error_log

/usr partition also contain domlogs of every domain. It uses the more disk space. You can move /usr/local/apache/domlogs directory to /home/


Regards,
Rahul Mudavadkar
In this scenario where one finds logs are the culprit of large disk space consumption, I recommend enabling log rotation so it is easier to archive old logs (if they need to be archived) or simply delete archived logs.

There are two screens in WHM that deal with log rotation, one for Apache logs and the other for cPanel logs. To enable log rotation for Apache logs, you would go to WHM -> Service Configuration -> Apache Configuration -> Log Rotation. To enable log rotation for cPanel logs, go to WHM -> Service Configuration -> cPanel Log Rotation Configuration. Both screens have text at the top indicating where the logs will be archived to.
 

jols

Well-Known Member
Mar 13, 2004
1,110
3
168
Hello,

/usr contain apache logs in directory /usr/local/apache/logs/ you have to check log files size. You can empty the file by running following command.

echo > error_log
Thanks Rahul. Pardon my newbie grade question here, but what exactly does "echo > error_log" do? Does this just wipe all the error logs?

/usr partition also contain domlogs of every domain. It uses the more disk space. You can move /usr/local/apache/domlogs directory to /home/
Yes, but isn't there another step? After moving /domlogs directory to /home/ wouldn't you also have to change some references in the cPanel system so that the logs in this new location will continue to update and be accessed by such stuff as AWStats, etc.?
 

jols

Well-Known Member
Mar 13, 2004
1,110
3
168
Okay, I think I know the answer to my "another step?" question above. We will just create a symlink so the system can still find the domlogs directory.

Sound about right?

Thanks much for your help.
 

jols

Well-Known Member
Mar 13, 2004
1,110
3
168
Okay, did that, and also found two rather large directories in /usr/local named

apache.backup

and

apache.backup.archive

Once moved to /root, the /usr dir is now back down to reasonable levels.

Just in case this helps someone else having the same issue.

Thanks.
 

nibb

Well-Known Member
Mar 22, 2008
319
5
68
In this scenario where one finds logs are the culprit of large disk space consumption, I recommend enabling log rotation so it is easier to archive old logs (if they need to be archived) or simply delete archived logs.

There are two screens in WHM that deal with log rotation, one for Apache logs and the other for cPanel logs. To enable log rotation for Apache logs, you would go to WHM -> Service Configuration -> Apache Configuration -> Log Rotation. To enable log rotation for cPanel logs, go to WHM -> Service Configuration -> cPanel Log Rotation Configuration. Both screens have text at the top indicating where the logs will be archived to.
Thanks. I always wanted to know what those features are as in the cPanel documentation it says nothing about it besides it just rotate logs.

Whats the advantage or disadvantage of having this in use? Will it affect webstats?

I assume by your post that its safe to delete archived logs then.
 

shortfork

Well-Known Member
Sep 4, 2006
63
0
156
Thanks. I always wanted to know what those features are as in the cPanel documentation it says nothing about it besides it just rotate logs.

Whats the advantage or disadvantage of having this in use? Will it affect webstats?

I assume by your post that its safe to delete archived logs then.
Would you mind doing a bit more of a step one step two on this? I think many of us have the same problem with the /usr partition... TIA!

Shortz
 

sharmaine001

Well-Known Member
Jun 23, 2006
143
0
166
In this scenario where one finds logs are the culprit of large disk space consumption, I recommend enabling log rotation so it is easier to archive old logs (if they need to be archived) or simply delete archived logs.

There are two screens in WHM that deal with log rotation, one for Apache logs and the other for cPanel logs. To enable log rotation for Apache logs, you would go to WHM -> Service Configuration -> Apache Configuration -> Log Rotation. To enable log rotation for cPanel logs, go to WHM -> Service Configuration -> cPanel Log Rotation Configuration. Both screens have text at the top indicating where the logs will be archived to.
I dont think this works. I enabled all logs to rotate but its not rotating even if the file is greater than 300mb already
 

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,545
12
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
Twitter