Skip to main content

Disk space issues, and questions

Comments

5 comments

  • cPRex Jurassic Moderator
    Hey there! Here's what I see in my own /usr/ partition: [root@host usr]# du -h --max-depth 1 12K ./src 4.0K ./games 545M ./sbin 69M ./libexec 1018M ./lib 39M ./include 435M ./bin 2.6G ./local 4.0K ./etc 572M ./lib64 584M ./share 5.8G .
    /usr/local/cpanel is nearly the entire 2.6G represented in /usr/local/ from the above output. cPanel does have log rotation tools as outlined in our documentation here, so checking those out would definitely be worthwhile and will help out with questions 2 and 3: Log Rotation | cPanel & WHM Documentation Let me know if you need more than that!
    0
  • jasoncollege24
    based on your reply, it looks like /usr is the correct size. However, your reply doesn't provide a solution to questions 2, and 3. I've changed the size of rotated logs to 100MB in the WHM interface, which takes care of log rotation size for managed log files, but doesn't handle removal of these retained logs, which have never been needed. (the question was looking for a way to automatically remove these) I removed more than 5GB worth of unmanaged logs from /var/log/journal today, which is ridiculous, and *must* be done every 1-2 months, if I want to keep my free disk space. (the question was looking for a way to automatically remove these) Edit: for question 2, I added a script in /etc/cron.monthly which runs the command "rm -rf /var/log/journal/*" I'll probably add something similar for managed logs, once they start rotating. Thanks for the help! :)
    0
  • cPRex Jurassic Moderator
    A default server doesn't have the /usr/local/cpanel/logs/archive directory, so can't say for sure what exactly would have created and placed files there. As far as /var/log/journal, that isn't something that is controlled by cPanel either, but is handled directly by the operating system. This can usually be controlled by options in the /etc/systemd/journald.conf file, but a cron deleting those entries is also safe as long as you don't remove the directory itself.
    0
  • jasoncollege24
    the directory /usr/local/cpanel/logs/archive is not created on install. It is used by cPanel to rotate (archive) managed logs, and is only created the first time the logs are rotated. WHM tells you about this archive destination, if you login, and go to Home > Service Configuration > cPanel Log Rotation Configuration. This was further proved, when I lowered the rotation threshold from the default of 300MB, to 100MB, causing multiple managed logs to be rotated, because many ranged from 100-150MB in size. I chose the cron method, for the journal logs, because it's a bit easier for someone still learning linux to add a simple script, than it would be to look up various logs, their settings, and how to change them. My preferred Linux OS is ubuntu, which is not supported by cPanel. and CentOS is definitely a bit different than ubuntu, so it's still a learning curve. The script leaves the /var/log/journal/ directory in place, and deletes everything in it. Once I figure out the best timing for doing the same to managed logs, I will likely add another script to do something similar. How do I mark this issue as being resolved?
    0
  • cPRex Jurassic Moderator
    There isn't a way for end users to do that, but I've marked it as resolved on my end now.
    0

Please sign in to leave a comment.