Sponsorluk

How to delete Backups in WHM/Cpanel with terminal

0
6K

Deleting old backups from the /backup directory in WHM or Cpanel is a complex process if you are managing a VPS server. However, if you are using shared web hosting companies like Namecheap and SiteGround, things are much simpler as you can delete backups with a single click using their customized backup systems or Softaculous.

Backup Problems

When I Installed WHM for the first time, I enabled monthly, weekly, and daily auto backups. My website disk usage of 10 GB suddenly rose to 99 GB within a few weeks. Buying more disk space was not an option because using more than 100 GB was not making financial sense. Therefore, I resorted to finding out ways of decreasing disk usage by removing old backups.

Below is how I managed to delete the backups after several hours of my website being down, reading tutorials, and failed command attempts.

How to delete Backups in WHM using Terminal

We are going to use the WHM terminal to delete the backups. You can also use an SSH client like PuTTY. This procedure assumes that you have used Terminal before and understand what you are doing.

Open Terminal in WHM or using PuTTY and log in using your root credentials then start running the commands below (do not include # before the commands).

  • Check disk space: # df -h
  • Go to the backup folder: # cd /backup
  • Check backup dates to delete (daily, weekly, or monthly): # dir
  • Backup dates will be listed in this format; 2019-11-26 monthly transports.db 2023-02-17 weekly
  • Run this command to delete backups by date: # rm -rf  2019-11-26

Replace the date above with your backup date.

IMPORTANT! Kindly note that if you run the command “rm -rf” without dates or a specified folder you will delete everything. Therefore proceed with caution. If you do not know what you are doing then DO NOT use the “rm -rf” command.

To go back and check if the disk usage has reduced after the deletion, run the command: # cd ..

cd..” means go back by one folder.

Conclusion  – Backup tip

If you want to avoid running out of disk space, do not keep more than one backup per day.  Also, ensure that you have carefully read the backup configuration options in WHM, then enable or disable scheduling and retention options that are necessary and unnecessary respectively.

Sponsorluk
Sponsorluk
Site içinde arama yapın
Sponsorluk
Kategoriler
Read More
Health
Hypoparathyroidism Treatment Market Industry, global Share Report 2023-2030
The  Hypoparathyroidism Treatment Market Industry was valued at USD 1.38 billion...
By wilsonjohn 2024-01-03 06:11:08 0 4K
Oyunlar
Chrome VPNs – Top Picks for Privacy & Security
Top Chrome VPNs If you use Chrome—whether on a Chromebook or another device—a...
By xtameem 2025-10-11 01:01:08 0 230
Crafts
Peace In War || Peaceinwar Clothing Store || Official Shop
Peace In War Clothing: Fashion That Blends Struggle and Serenity Introduction Fashion has...
By Raspberry786 2025-09-18 09:37:49 0 1K
Other
Innovation Driving Growth in the Set Top Box Market
According to the recent analysis by Polaris Market Research, the Set Top Box Market is...
By Aarya 2025-08-01 12:44:19 0 1K
Networking
Digital Dentistry Market will reach at a CAGR of 11.6% from to 2030
The global digital dentistry market size is expected to grow at a CAGR of...
By vipinmsg 2023-04-06 09:11:08 0 6K
Sponsorluk
TikTikTalk https://tiktiktalk.com