Knowledge Base

How Can We Help?

Some Steps to Reduce Disk Space on cPanel Server (For VPS/Cloud Clients Only)

You are here:
  1. One of the main causes of heavy disk space usage is the backup stored on the server. Instead of downloading the backup to their local machine, cPanel users often store their backups on the server itself. To free up disk space, you can delete your backups from the server using the following script.
    # Use the following script to delete backups from the server:
        for user in `/bin/ls -A /var/cpanel/users` ;
        do
          rm -fv /home/$user/backup-*$user.tar.gz ;
        done
  2. Alternatively, you can move the backup to another server. Use the scp or rsync command to transfer the backup file to another server. Additionally, you can configure backup in WHM by following the steps below.
    1. Login to WHM.
    2. Navigate to “Backup Configuration” under the Backup section.
    3. Click on the “Enable” radio button, then click on the “Create new destination” button.
    4. Fill in the destination server details and click on the “Save Destination” button.
    5. Finally, click on the “Save Configuration” button to save all changes.
  3. Another way to free up disk space is to delete temporary files. When uploading files via File Manager, cPanel creates a copy of those files in the tmp folder. You can delete these files using the following command.
    # Use the following command to delete temporary files:
        rm -fv /home/*/tmp/Cpanel_*
  4. Remove package manager files. Run the following command to clean up files that are not needed for the YUM repository.
    # Run the following command to clean up YUM repository files:
        yum clean all
  5. Delete temporary files created during failed FTP uploads. When a user tries to upload files to the server and the upload fails for some reason, the FTP daemon creates a temporary file. You can delete these files using the following instructions.
    # Use the following commands to delete temporary files:
        find .pureftpd-upload | xargs rm -fv
  6. You can also remove unused cPanel accounts from WHM to reduce disk usage. Follow these steps to accomplish this.
    1. Login to WHM.
    2. Navigate to “Terminate Accounts” in the “Account Functions” section.
    3. Select the unwanted account and click on the “Remove” button.
  7. In some cases, log files can consume a large amount of disk space. Most log files are stored in the location /var/log. Their size and rotation frequency can be adjusted in the /etc/logrotate.conf file. You can also enable Log Rotation from your WHM.
    1. Login to WHM.
    2. Navigate to “Apache Configuration” under “Service Configuration”.
    3. Click on “Log Rotation”.
    4. Check the boxes for “access_log” and “error_log”.
    5. Click the “Save” button.

If you need any further assistance, please contact our support department.

Leave a Comment