Applicable to:
- Plesk for Linux
Question
How to clean temporary Plesk files on a Linux server?
Answer
There are two ways in Plesk to safely clean temporary Plesk files on a Linux server.
Note: Cleaning temporary Plesk files may not free up a lot of disk space. That means this solution may not help when there is no free disk space on a server.
Note: This solution is applicable to Plesk 17.8 on the following operating systems:
- CentOS/RHEL 7
- Debian 8
- Debian 9
- Ubuntu 16
- Ubuntu 18
For other OSes and Plesk versions, see the command-line instructions.
-
Open the Plesk Repair Kit by navigating to the following URL:
Note: Replace "203.0.113.2" in the URL below with your IP address/hostname.
PLESK_INFO: https://server.example.com:8443/repair/
OR
PLESK_INFO: https://203.0.113.2:8443/repair/
-
Input your Plesk Administrator credentials in the corresponding Username and Password fields and click Sign in.
-
Click the Free Up Disk Space button to clean temporary files:
-
Connect to a Plesk server via SSH.
-
Delete temporary files that are older than X days from the
/tmp
and/var/tmp/
directories. In this example, we are removing temporary files that are older than 14 days:# find /tmp -type f -mtime +14 -exec rm {} \;
# find /var/tmp -type f -mtime +14 -exec rm {} \; -
Delete temporary files created by Plesk and its services:
Note: We recommend to run these commands when there are no active Plesk Installer and Plesk backup tasks on a server. To make sure there are no such tasks, check the Additional Information section.
-
Temporary Plesk backup files:
# rm -rf /usr/local/psa/PMM/tmp/*
-
Other temporary files:
# rm -rf /usr/local/psa/tmp/*
-
Additional Information
-
Checking if Plesk Installer is running
In your Linux terminal, run the command:
# ps aux | grep autoinstaller | grep -v "grep"
-
No output means Plesk Installer is inactive.
-
If an output like below is returned:
CONFIG_TEXT: root 6075 1.1 1.6 194908 17232 ? S 09:28 0:00 /usr/local/psa/admin/bin/autoinstaller --service-mode --enable-xml-output --ssl-cert /usr/local/psa/admin/conf/httpsd.pem --branch release,stable --web-interface --with-ssl --disable-browser
it means that Plesk Installer is running. In this case, it is required to wait until it is finished (up to 30 minutes). If the process is still active after 30 minutes, kill it manually using the resolution steps from this KB article.
-
-
Checking if a Plesk backup task is running
In your Linux terminal, run the command:
# plesk sbin pmmcli --get-tasks-list Backup | grep working
-
No output means there are no active backup tasks.
-
If an output like below is returned:
CONFIG_TEXT: <working>
</working>it means that some backup task is running. In this case, it is required to wait until it is finished.
-
Comments
7 comments
https://IPADDRESS:8443/repair is 404 not found on all my servers.
This will break Media Uploader (error: "missing temporary dir") in all Wordpress sites on the server using PHP FPM (FastCGI is ok), php.ini unaltered.
@Marco Marsala,
Hi!
1) Plesk repair kit presents only on Plesk Onyx 17.8. Additionally, please check if your OS uses systemd init system (https://docs.plesk.com/en-US/onyx/administrator-guide/plesk-administration/repair-kit.79310/).
2) I can suppose that /tmp folder itself was accidentally removed. Please make sure that there is an asterisk in rm -rf /tmp/* when removing the content of /tmp
I confirm /tmp was not removed. The issue happes with FPM and Wordpress 5.x only.
@Marco Marsala, Hello there!
I was trying reproducing this issue on a test environments and different WordPress versions, however, have not reproduced. This is a really interesting case, that has a number of variables within it. Thus, we would like for this case to reach Technical Support in order to investigate it deeper. Please create a request according to this article: How to submit request to Plesk Support
Was there ever a solution for this? I desperately need to clear some space, but I don't want it to impact my Wordpress website.
Hi @Marnette,
Certain temporary files are not managed by Plesk but by the OS. For that matter, we recommend applying the solution in this article and I also recommend using the following extension https://www.plesk.com/extensions/diskspace-usage-viewer/.
Please sign in to leave a comment.