Patrocinado

How to delete Backups in WHM/Cpanel with terminal

0
6KB

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.

Patrocinado
Patrocinado
Pesquisar
Patrocinado
Categorias
Leia mais
Outro
Press Release: Appointment Scheduling Software Market: Scheduling Success - Dynamics and Innovations 2024
  The global Appointment Scheduling Software Market is anticipated to grow from USD 0.43...
Por Monika312 2024-07-19 06:43:52 0 4KB
Outro
Overcoming the Barriers of the Physical World with AI
The rapid advancement of artificial intelligence (AI) is revolutionising our lives and work,...
Por martechcubejohn 2023-11-16 06:21:35 0 6KB
Outro
WOLVERHAMPTON VS GILLINGHAM PREDICTION 20.12.2022
  Competition: EFL Cup Date: 20th December 2022 Kickoff: 19:45 / 20:45 CET...
Por thanhle12 2022-12-19 11:55:15 0 11KB
Jogos
Automaty online z funkcją „kup bonus” – czy naprawdę się opłacają?
Automaty online z funkcją „kup bonus” – czy naprawdę się opłacają? Świat gier...
Por JohnWhite 2025-03-26 18:14:32 0 2KB
Outro
Aircraft And Aircraft Parts Manufacturing And Repair & Maintenance Market Share, Growth, Trends Analysis, Report 2024-2030
  Global Aircraft And Aircraft Parts Manufacturing And Repair & Maintenance...
Por Amiya 2024-09-03 11:22:50 0 4KB
Patrocinado
TikTikTalk https://tiktiktalk.com