There was a problem loading the comments.

cPanel disk cleanup — finding and safely freeing space

Support Portal  »  Announcements  »  Viewing Article

  Print

When to use this

Server alerts on disk usage above 90%, or customers report failed uploads and mail deferrals caused by a full partition.

Find what is consuming space

  1. Overall picture: df -h — identify the full partition (usually /home or /var).
  2. Largest directories: du -xhd1 /home | sort -h | tail -20
  3. cPanel-specific heavy hitters: stale local backups (/home/*/backup-*.tar.gz, /backup), the mail queue (exim -bpc), Apache domlogs, and MySQL binlogs (/var/lib/mysql/*-bin.*).

Safe cleanup order

  1. Remove stale local backups that are already shipped to remote storage.
  2. Rotate and compress logs: logrotate -f /etc/logrotate.conf — truncate active logs, never delete them.
  3. Purge old MySQL binlogs: PURGE BINARY LOGS BEFORE NOW() - INTERVAL 7 DAY;
  4. Clear EasyApache and cPanel update caches.
  5. Ask the customer before touching anything inside their home directory.

Prevention

Enable backup pruning (retain two local copies at most), set the WHM disk-usage warning to 80%, and add the partition to monitoring with an alert at 85%.


Share via
Did you find this article useful?  

Comments

Add Comment

Replying to  

CAPTCHA

On-Premise Help Desk Software by SupportPal
Development License - This installation is using a license which is not valid for production use.
© WIPL