• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion
  • Inviting everyone to the UX test of a new security feature in the WP Toolkit
    For WordPress site owners, threats posed by hackers are ever-present. Because of this, we are developing a new security feature for the WP Toolkit. If the topic of WordPress website security is relevant to you, we would be grateful if you could share your experience and help us test the usability of this feature. We invite you to join us for a 1-hour online session via Google Meet. Select a convenient meeting time with our friendly UX staff here.

Resolved Need to remove backups on CentOS 7 server via SSH

seanfod

New Pleskian
Hello. I am new to this forum and to SSH really as i have always accessed my VPS via Plesk. I have a CentOS 7 VPS and it appears i have run out of disk space as i cannot access the Plesk control panel and WordPress websites are coming up with database connection errors now after attempting to backup a farly large WordPress site.

I knew that i was close to maxing out the disk space and feel pretty stupid now for not doing something sooner.

My question is, how can i free up disk space via SSH and how do i remove server backups via SSH?

Thank you in advance...
 
Hi @seanfod, thank you for your post. You can

1) Find out the location of your local backups:
# grep DUMP_D /etc/psa/psa.conf
Normally it is /var/lib/psa/dumps, but just in case it was modified it is better to check it in the configuration file first.

2) Then descend into that path, let's say it is /var/lib/psa/dumps
# cd /var/lib/psa/dumps

3) There you can see several daily and historical dump files that should not be removed because you might still need them, and you can see further paths like /clients and /domains. You are looking for the /clients path. Descend into it (# cd clients). From there you see further directories that are named like the user names on your Plesk.
Maybe you are only interested in the five backup directories that occupy the most space. Then simply descend into the "clients" directory and run
# du -hs * | sort -h | tail -n 5
All these directories contain the full backup data of these users. Let's say one of these paths is named "myuseraccount", then you can

4) remove that user path to remove all of the users backup information, e.g.
# rm -R -f myuseraccount
or
# rm -R -f /var/lib/psa/dumps/clients/myuseraccount
 
Hi @seanfod, thank you for your post. You can

1) Find out the location of your local backups:
# grep DUMP_D /etc/psa/psa.conf
Normally it is /var/lib/psa/dumps, but just in case it was modified it is better to check it in the configuration file first.

2) Then descend into that path, let's say it is /var/lib/psa/dumps
# cd /var/lib/psa/dumps

3) There you can see several daily and historical dump files that should not be removed because you might still need them, and you can see further paths like /clients and /domains. You are looking for the /clients path. Descend into it (# cd clients). From there you see further directories that are named like the user names on your Plesk.
Maybe you are only interested in the five backup directories that occupy the most space. Then simply descend into the "clients" directory and run
# du -hs * | sort -h | tail -n 5
All these directories contain the full backup data of these users. Let's say one of these paths is named "myuseraccount", then you can

4) remove that user path to remove all of the users backup information, e.g.
# rm -R -f myuseraccount
or
# rm -R -f /var/lib/psa/dumps/clients/myuseraccount
Many thanks Peter. Much appreciated :)
 
Back
Top