Applicable to:
- Plesk for Linux
- Plesk for Windows
Question
-
How to remove Plesk backups?
-
How to remove old Plesk backup logfiles?
-
Backups have been removed from Plesk, but their files and logs exist on the file system. How to remove these backup files and logs?
Answer
Note: It is possible to set a period of time after which backups will be removed automatically. In addition, it is possible to limit the number of backups to store.
When a scheduled backup task is completed successfully, the corresponding log files are deleted automatically.
Via Plesk
-
In Plesk, go to Tools & Settings > Backup manager (server-wide backups) or Websites & Domains > Backup Manager (domain backups).
-
Choose a backup that should be deleted and click Remove. Backup files will be also removed from the system.
Via a command-line interface
-
For Plesk on Linux
-
Connect to a Plesk server via SSH.
-
Find the backup_infoXXXX.xml file using a backup creation date:
# /usr/local/psa/admin/bin/pmm-ras --get-dump-list | grep .xml:
In this example, the domain level backup was created on 10.08.2019 (19.08.10):
# /usr/local/psa/admin/bin/pmm-ras --get-dump-list | grep .xml:
<message>domains/example.com/backup_info_1908101555.xml: </message> -
Delete the backup by specifying the corresponding *.xml file. For example:
# /usr/local/psa/admin/bin/pmm-ras --verbose --debug --delete-dump --dump-specification=backup_info_1908101555.xml --session-path=/var/log/plesk/PMM
-
-
For Plesk Obsidian on Windows Server
-
Connect to a Plesk server via RDP.
-
Find the backup_infoXXXX.xml file using a backup creation date:
C:\> "%plesk_bin64%"\pmm-ras.exe --get-dump-list | findstr .xml:
In this example, the domain level backup was created on 22 July 2020:
C:\> "%plesk_bin64%"\pmm-ras.exe --get-dump-list | findstr .xml:
<message>backup_info_2007220826.xml: </message>If Plesk was installed into a custom location, replace C:\Program Files (x86) in the command above with the custom location
-
Remove the backup by specifying the corresponding *.xml file. For example:
C:\> "%plesk_bin64%"\pmm-ras.exe --verbose --debug --delete-dump --dump-specification=backup_info_2007220826.xml
-
-
For Plesk Onyx or earlier on Windows Server
-
Connect to a Plesk server via RDP.
-
Find the backup_infoXXXX.xml file using a backup creation date:
C:\>"%plesk_bin%/pmm-ras" --get-dump-list | findstr .xml:
In this example, the domain level backup was created on 10.08.2019 (19.08.10):
C:\>"%plesk_bin%/pmm-ras" --get-dump-list | findstr .xml:
<message>domains/example.com/backup_info_1908101555.xml: </message> -
Remove the backup by specifying the corresponding *.xml file. For example:
C:\> "%plesk_bin%\pmm-ras.exe" --verbose --debug --delete-dump --dump-specification=backup_info_1908101555.xml --session-path="%plesk_dir%PMM"
-
-
Connect to a Plesk server via SSH.
-
Delete directories with old backup files created before a desired date from
/var/log/plesk/PMM/
:# find /var/log/plesk/PMM/ -name 'backup*' -type d -ctime +XX -exec rm -rf {} +;
where XX is a number of days before the current date.
-
Connect to a Plesk server via SSH.
-
Delete backup directories and files created before a desired date from
/var/log/plesk/PMM/
and/var/lib/psa/dumps
:-
Remove backup logfiles:
# find /var/log/plesk/PMM/ -name 'backup*' -type d -ctime +XX -exec rm -rf {} +;
-
Remove backup files:
# find /var/lib/psa/dumps -name 'backup*' -type f -ctime +XX -exec rm -rf {} +;
where XX is a number of days before the current date.
-
Comments
12 comments
I'm not sure if there is an equivalent for Windows, but if there isn't it would be nice to see one as I have several clients that have been converted from reseller to customers in Plesk on Windows
Hello @Steven,
The GUI steps from this article are identical for Linux and Windows.
Command-line solution for removing backups is also in place.
Hello,
I've removed old files this way, but they still are on the hard drive (and not in the list anymore). I've tried to manually remove them with "Diskspace usage viewer" and it says they can't be removed. What should I do?
Thanks.
Hello Gabriel, the command below has params:
find /var/log/plesk/PMM/ -name 'backup*' -type d -ctime +XX -exec rm -rf {} +;
If any files left means they either do not match name pattern or do not match number of dates before the current date.
Consider modifying scripts according to your needs to remove these files.
Thanks a lot Anton !
Boa tarde,
Como posso apagar todos os backups? O PLESK apenas me deixa selecionar o primeiro. Como Fazer?
Anton Maslov
is not shouldn't be type f
find /var/log/plesk/PMM/ -name 'backup*' -type f -ctime +XX -exec rm -rf {} \;
Hello Greg G
We're removing the whole directories, that's why "-type d".
Carlos Dias
If you're an admin of this Plesk installation, you'll be able to remove them from Tools & Settings > Backup Manager.
After all that was written above, I have a question:
Plesk stores all my backups automatically on an external FTP-server. Within a long time there are many files in /var/lib/psa/dumps. Is there a problem, if I delete the content of this folder completely via SSH as root?
Thanks in advance
Joe
I'm unable to delete a backup because i can't select it to be deleted - i also run the commands but didn't help.
Error log
Unable to create remote backup, the local backup will be created. Error: Unable to export backup: Transport error: unable to check directory existence: Curl error: (28) Timeout was reached: Last FTP request: Last FTP response:
Unable to delete the incomplete remote backup. Error: Failed to exec pmm-ras: Exit code: 126: Transport error: unable to check file existence: Curl error: (28) Timeout was reached: Last FTP request: Last FTP response:
Use Long Path Tool, Long Path Tool can simplify and probably end your problems in unlocking, managing and renaming files that appear to have a long filename.
What is the point of having the GUI if it doesn't work? I can't select files to remove. all the select boxes are greyed out and I am logged in as admin.
Please sign in to leave a comment.