Plesk

How to list all domains in Plesk overusing the disk space?

Question

There are some domains with disk space overuse in Plesk.

How to get a list of all domains that are overusing the disk space?

Answer

To get a list of subscriptions that overuse available disk space and show the overused amount in megabytes, proceed with the following steps:

  1. Connect to the server via SSH or via RDP

  2. Execute the following command:

    # plesk db "SELECT * FROM (
    SELECT domains.name AS 'Name'
    , clients.pname AS 'Client'
    , round(real_size/1024/1024,2) AS 'Used'
    , round(Limits.value/1024/1024,2) AS 'Allowed'
    , round((real_size/1024/1024 - Limits.value/1024/1024),2) AS 'Difference'
    FROM domains
    INNER JOIN clients ON domains.cl_id=clients.id AND clients.parent_id = '1'
    INNER JOIN Subscriptions ON domains.id=Subscriptions.object_id AND Subscriptions.custom='false'
    INNER JOIN SubscriptionProperties ON SubscriptionProperties.subscription_id=Subscriptions.id AND SubscriptionProperties.name='limitsId'
    INNER JOIN Limits ON Limits.id=SubscriptionProperties.value
    WHERE Limits.limit_name='disk_space' AND round(Limits.value/1024/1024,2) > 0 AND Limits.value NOT LIKE '104857600'
    ) a WHERE a.Difference > 0;"

The output will look similar to the following:

+-------------+----------+--------+---------+------------+
| Name        | Client   | Used   | Allowed | Difference |
+-------------+----------+--------+---------+------------+
| example.com | Jane Doe | 103.51 | 10.00   | 93.51      |
+-------------+----------+--------+---------+------------+

Note: It is suitable for both Linux and Windows.

Exit mobile version