Skip to content
  • About
  • Contact
  • Docs
  • Features
  • Home

Configurations

5
  • Setup RAID Level 6
  • Setup RAID Level 5
  • How To Add Swap on RHEL or Centos based system
  • Website Migration to Non-Panel OpenLiteSpeed Server
  • Linux Server Performance Tuning

CyberPanel

9
  • Mounting /tmp on a Separate File
  • Updating CyberPanel Main VirtualHost Configuration
  • Updating CyberPanel vHosts Configuration
  • How to Change CLI PHP on CyberPanel
  • How to Update PHP Version to 8.1 in CyberPanel (From 7.3, 7.4, or 8.0)
  • CyberPanel Server Cleanup: Logs, Dumps, Backups
  • CyberPanel Full LSPHP Installation PHP 7.4 – 8.3
  • CyberPanel / OpenLiteSpeed: Clean LSPHP Session Files
  • SSL Certificate Management in CyberPanel via SSH

Hestia Control Panel

6
  • Fixing Email Bounce Back Issue in Hestia (Exim4 Blacklist Rejection)
  • Managing Fail2Ban in HestiaCP Server
  • Installing and Configuring PHP Versions in HestiaCP
  • phpMyAdmin Not Found in HestiaCP
  • Setting Up a Reverse Proxy for any Port in HestiaCP
  • How to Install Let’s Encrypt SSL in Hestia CP (Hostname, Admin Panel, and Email Server)

WHM/cPanel

6
  • Setting Up a Reverse Proxy on cPanel/WHM for Port 8081
  • How to increase the size of the cPanel-generated /tmp filesystem
  • Installing Old PHP Versions on a cPanel/WHM Server
  • Fixing “550: Your Country is Not Allowed to Connect to This Server” Error in Exim (cPanel)
  • Enable WP-CLI in CageFS on CloudLinux Servers (WHM/cPanel)
  • Securing /tmp and /var/tmp with a Dedicated Loopback Filesystem

Nagios

5
  • Service Checks
  • Uptime Checks
  • Disk Space Checks
  • Load Checks
  • Email Related Checks

WordPress

3
  • WordPress Core Reinstallation Guide
  • Managing WordPress Users via WP-CLI
  • Website Duplication, Migration, or Domain Change

Operating System

1
  • Server Reboot (RHEL or Centos based system)

AWS

1
  • How to Resize EBS Volumes on AWS

Databases

2
  • MySQL
    • Optimizing MySQL Performance
    • Recovering MySQL in Plesk When InnoDB Crashes

CloudLinux

4
  • Moving cagefs-skeleton directory
  • Enable WP-CLI in CageFS on CloudLinux Servers (WHM/cPanel)
  • Enable bc in CageFS on CloudLinux Servers(WHM/cPanel)
  • How to Upgrade MySQL 5.x to MySQL 8.0 on CloudLinux (WHM server) with MySQL Governor

Cloudflare

1
  • Configuring Security Headers in Cloudflare

ISPmanager

1
  • Install Free SSL (Let’s Encrypt) for domain.tld on ISPmanager with NGINX

Plesk

1
  • Plesk Admin Login Blocked – IP Restriction Recovery Guide

VPN

4
  • Install OpenVPN Open Source in Linux CentOS Ubuntu Debian Servers
  • Protected: OpenVPN Installation & Fix Wiki (CloudLinux / CentOS 7 & 8)
  • Outline VPN Installation & Management Guide
  • Installing AdGuard Home on Debian/Ubuntu (Docker)
View Categories
  • Home
  • Docs
  • Nagios
  • Disk Space Checks

Disk Space Checks

Why We Do Disk Space Checks and File Cleanup
Why Disk Space Checks are Important
  • To monitor and alert when server disks are getting full.
  • To prevent system crashes or downtime due to disk full errors.
  • To ensure critical applications like databases, web servers, or backups do not fail.
  • To maintain overall health and performance of the server.
  • Nagios checks help us detect issues early before they impact production.
Why We Need to Remove Large and Old Files
  • Disk space fills up over time with logs, backups, cache, and temp files.
  • Old or unnecessary files waste storage and slow down server performance.
  • Cleaning up frees space for important system operations and new backups.
  • Removing large error logs, old backups, and cache avoids unexpected disk usage spikes.
  • Regular cleanup reduces system load and keeps server maintenance under control.
Nagios Disk Space Checks

Check Diskslash

Command:  /usr/local/nagios/libexec/check_nrpe -H localhost -c check_disk_slash

Check DiskHome

Command: /usr/local/nagios/libexec/check_nrpe -H localhost -c check_disk_home

check_disk_backup

Command:  /usr/local/nagios/libexec/check_nrpe -H localhost -c check_disk_backup

These checks monitor disk usage for /, /home, and backup partitions.

Disk Cleanup Procedures

 

Clear YUM Cache

Navigate to the YUM cache directory: cd /var/cache/yum/

List files:

ls -ll

Remove a specific file:

rm -f filename

Clean all cached files:

yum clean all
Find Large Files

Find .tar.gz files larger than 300MB

find / -type f -size +300M -iname "*.tar.gz" -exec du -sch {} \; | grep -v total

Find .zip files larger than 200MB

find / -type f -size +200M -iname "*.zip" -exec du -sch {} \; | grep -v total

Find .log files larger than 100MB

find / -type f -size +100M -iname "*.log" -exec du -sch {} \; | grep -v total

Find error_log files larger than 50MB inside /home

find /home -type f -size +50M -iname "*error_log" 2>/dev/null -exec du -sch {} \; | grep -v total

Find php.error.log files larger than 50MB inside /home

find /home -type f -size +50M -iname "*php.error.log" 2>/dev/null -exec du -sch {} \; | grep -v total

Find any files larger than 600MB in /home

find /home/ -type f -size +600000k -exec ls -lh {} \; | awk '{ print $9 ":" $5 }'
Find Large Directories

Find cache* directories larger than 5MB inside /home

find /home -type d -size +5M -name 'cache*' -exec du -sh {} \; | grep -v total

Find .trash* directories larger than 1MB inside /home

find /home -type d -name '.trash*' -exec du -sh {} \; | awk '$1 > "1" {print}'
Remove Specific Log Files

Check files starting with logs.21978

ls -lah | grep logs.21978

Remove files starting with logs.21978:

find . -maxdepth 1 -type f -name 'logs.21978*' -exec rm -fv {} +
Remove Files by Date Range

List files created between 1st Jan 2024 and 31st Mar 2024:

find . -type f -newermt '01 jan 2024 00:00:00' -not -newermt '31 mar 2024 00:00:00' -ls

Delete files created between 1st Jun 2021 and 31st Dec 2023:

find . -type f -newermt '01 jun 2021 00:00:00' -not -newermt '31 dec 2023 00:00:00' -delete

Delete .zip files created between 1st Jan 2024 and 1st Apr 2024:

find . -type f -name "*.zip" -newermt '01 jan 2024 00:00:00' -not -newermt '01 apr 2024 00:00:00' -delete
Notes
  • Always verify files with ls  or find before running delete commands.
  • Use du -sh to check folder sizes.
  • Take backups if needed before removing important files.

 

Table of Contents
  • Why We Do Disk Space Checks and File Cleanup
    • Why Disk Space Checks are Important
    • Why We Need to Remove Large and Old Files
  • Nagios Disk Space Checks
  • Disk Cleanup Procedures
    • Clear YUM Cache
    • Find Large Files
    • Find Large Directories
    • Remove Specific Log Files
    • Remove Files by Date Range
    • Notes

Share This Article :

  • Facebook
  • X
  • LinkedIn
  • Pinterest

Was it helpful ?

  • Happy
  • Normal
  • Sad
  • About
  • Contact
  • Docs
  • Features
  • Home

© 2026 Panel Web Hosting

  • About
  • Contact
  • Docs
  • Features
  • Home