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*' -ctime +XX -exec rm -rf {} +;
where XX is a number of days before the current date.
-
Comments
6 comments
I have lots of other files in the /var/lib/psa -- some seems to be left over from migration days..
Can't we delete them? The above commands did nothing
# du -sh dumps/
199G dumps/
drwxr-x---. 7 psaadm psaadm 208K May 26 09:41 .
-rw------- 1 root root 3.5M May 26 09:41 mysql.preresolve.20230526-094109.dump.gz
-rw------- 1 root root 5.7K May 26 08:39 mysql.preupgrade.apsc.18.0.52-18.0.52.2023
0526-083923.dump.gz
-rw------- 1 root root 3.4M May 26 08:39 mysql.preupgrade.18.0.52-18.0.52.20230526-
083920.dump.gz
-rw------- 1 root root 3.5M May 26 05:44 mysql.daily.dump.0.gz
-rw------- 1 root root 3.5M May 25 06:00 mysql.daily.dump.1.gz
-rw------- 1 root root 3.5M May 24 05:58 mysql.daily.dump.2.gz
-rw------- 1 root root 3.5M May 23 05:39 mysql.daily.dump.3.gz
-rw------- 1 root root 3.5M May 22 05:47 mysql.daily.dump.4.gz
-rw------- 1 root root 3.5M May 21 06:23 mysql.daily.dump.5.gz
drwxr-x--- 2 root root 4.0K May 21 03:59 .run
-rw------- 1 root root 502K May 21 03:57 backup_info_2305070213_2305210212.xml
-rw-r----- 1 root root 781 May 21 03:57 backup_ext_performance-booster_2305070213_
2305210212.tzst
-rw-r----- 1 root root 1.1M May 21 03:57 backup_ext_dist_performance-booster_230507
0213_2305210212.tzst
-rw-r----- 1 root root 2.2M May 21 03:57 backup_ext_dist_docker_2305070213_23052102
12.tzst
-rw-r----- 1 root root 214 May 21 03:57 backup_ext_traffic-monitor_2305070213_2305
210212.tzst
-rw-r----- 1 root root 6.4M May 21 03:57 backup_ext_dist_traffic-monitor_2305070213
_2305210212.tzst
-rw-r----- 1 root root 34 May 21 03:57 backup_ext_statistics-usage-manager_230507
0213_2305210212.tzst
-rw-r----- 1 root root 491K May 21 03:57 backup_ext_dist_statistics-usage-manager_2
305070213_2305210212.tzst
turgut kalfaoglu could you please the exact command you applied here?
Cannot delete anything at /var/lib/psa/dumps :(
This guide did not work...
hi Adel Csakvary
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.
Most likely you did not change the XX.
Or are you receiving an error?
I wonder if the best practice is still the usual home-brewed Bash script or a more structured and consistent approach. Every Linux-based distribution includes the
systemd-tmpfiles-clean
service.Wouldn't it be more advisable to use a configuration file like this:
which leverages existing system services instead of relying on custom scripts?
Hostmaster Scibile Network SA thank you for the recommendation. IF that solution works for you please use it.
Please sign in to leave a comment.