How To Locate Backups Files via SSH and Delete

dnow

Member
Dec 12, 2013
5
0
1
cPanel Access Level
Root Administrator
Hello,

I recently ran into a storage issue with cpanel storing too many of my backups which should have been deleted. After contacting godaddy I was able to gain access to my site again but am unable to login to cpanel because I am out of diskspace (100%).
I have access to ssh as admin however I do not remember the name of my backup files in which need to be deleted. I have tried deleting some backups from my /backup/cpbackup using the b/u name in which I had downloaded to my physical hard drive but it doesn't seem to be working. Can somebody let me know how to find the actual name of the file so I can delete them? Thanks!
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,268
463
Hello :)

Backup archives are stored in the following locations by default:

For legacy backups:

/backup/cpbackup

For the new backup system:

/backup/$date

Are you not finding the archives in these directories?

Thank you.
 

dnow

Member
Dec 12, 2013
5
0
1
cPanel Access Level
Root Administrator
The issue I am having is that I don't know what the name of the backup is so when I run
rm -iv "backup name" it doesn't work. I have tried using the name in which the backup was downloaded but it doesn't work when trying in both directories (see below).
rm -iv backup-10.27.2013_10-32-11_dnow.tar.gz
rm: cannot remove `backup-10.27.2013_10-32-11_dnow.tar.gz': No such file or directory

Is there a way that I can search my backup folder for the proper name of the backup/backups to delete?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,268
463
Have you tried using the "ls" command to list the files in the directory? EX:

Code:
ls -al
Thank you.
 

dnow

Member
Dec 12, 2013
5
0
1
cPanel Access Level
Root Administrator
/backup/cpbackup
total 12
drwx--x--x 3 root root 4096 Nov 8 23:53 ./
drwx--x--x 3 root root 4096 Mar 6 2013 ../
drwx--x--x 5 root root 4096 Dec 11 01:07 monthly/

/backup/$date
total 12
drwx--x--x 3 root root 4096 Mar 6 2013 ./
dr-xr-xr-x 26 root root 4096 Dec 12 07:08 ../
drwx--x--x 3 root root 4096 Nov 8 23:53 cpbackup/

That is what displays in putty. Are those the file names? Doesn't look like what was displayed in file manager. I probably did have 12 backups in there but not all are displayed.
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,268
463
You have to browse to the sub-directories. EX:

Code:
cd /backup/cpbackup/monthly
ls -al
Please ensure you are careful when removing files. It appears you are not familiar with the command line environment, so removing files should be done with extreme caution. You may even want to consider consulting with a qualified system administrator.

Thank you.
 

dnow

Member
Dec 12, 2013
5
0
1
cPanel Access Level
Root Administrator
For the record the issue I had was the my backups were being installed in my home dir. That is why I was unable to locate them. Thanks again.