Author Topic: Continuous reduction of hosting space  (Read 17199 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
Continuous reduction of hosting space
« on: August 10, 2016, 03:48:02 PM »
Hello
The VPS server I use CWP panel, decreasing the area to be used about 100 MB each day. We had 12GB of free space from 6GB. Can you help with this?
« Last Edit: August 10, 2016, 03:51:31 PM by askinj »

Offline
*
Re: Continuous reduction of hosting space
« Reply #1 on: June 20, 2022, 07:33:23 AM »
Hello
The VPS server I use CWP panel, decreasing the area to be used about 100 MB each day. We had 12GB of free space from 6GB. Can you help with this?

Firstly install ncdu with
# yum install ncdu.

After that start ncdu. With that tool you can easily see what's taking your space.


Also you can clean some system apache logs.
Notice: First command list them all, so you can check them before cleaning, second command truncates to nothing.

# apache domain logs
# find /usr/local/apache/domlogs/ -type f -name "*.log" -exec ls -if {} \;
# find /usr/local/apache/domlogs/ -type f -name "*.log" -exec truncate --size 0 {} \;

# php-fpm system logs
# find /opt/alt/php-fpm*/usr/var/log/ -type f -name "php-fpm.log" -exec ls -if {} \;
# find /opt/alt/php-fpm*/usr/var/log/ -type f -name "php-fpm.log" -exec truncate --size 0 {} \;

# apache logs
# find /usr/local/apache/logs/ -type f -name "*log" -exec ls -if {} \;
# find /usr/local/apache/logs/ -type f -name "*log" -exec truncate --size 0 {} \;

# dovecot logs
# find /var/log/dovecot-* -type f -name "*log" -exec ls -if {} \;
# find /var/log/dovecot-* -type f -name "*log" -exec truncate --size 0 {} \;

# cwp_stats home folder clean
# find /home/*/cwp_stats/goaccess/ -type f -name "*.html" -exec ls -if {} \;
# find /home/*/cwp_stats/goaccess/ -type f -name "*.html" -exec rm {} \;


Offline
*****
Re: Continuous reduction of hosting space
« Reply #2 on: June 20, 2022, 05:52:52 PM »
remember to restart the services after deleting the files

Offline
*****
Re: Continuous reduction of hosting space
« Reply #3 on: January 22, 2023, 08:43:30 PM »
And consider implementing logrotate so you don't wind up with ever-bloating log files. Keep 7 (or at least 4) compressed logs, rotated weekly. Then you can still look back at errors, traffic patterns, or security breaches but not have to contend with log bloat!