Evaluate Disk Usage on Linux Plesk Server Print

  • 0

The following commands will assist you in evaluating your disk usage on a Linux Server with Plesk.

  • Get overview of available and used space

    df -h

    linux_diskoverview

    On this server the primary partition /dev/sda3 is using 12Gb out of the 21Gb allocation

  • Get a break-down of each root level folders usage

    du -hs /*

    linux_diskrootbreakdown

  • Show top 5 root level folders by disk usage

    du -sm /* | sort -rn | head -n 5

    linux_disktop5rootlevel

    On this server /var /root and /usr combine to about 11Gb

You will generally find a majority of disk space that can be freed up in logs.

Find Site Logs Over 10Mb

find /var/www/vhosts/*/statistics/logs/* -size +10M -exec ls -lh {} \; | awk '{print $5 , $9}'

linux_disksitelogs

Image Truncated for Fitment

On this server we have found just over 2Gb of site logs.

Delete Site Logs Over 10Mb

find /var/www/vhosts/*/statistics/logs/* -size +10M -exec rm -f {} \;

Find Server Logs Over 10Mb

find /var/log/* -size +10M -exec ls -lh {} \; | awk '{print $5 , $9}'

linux_diskserverlogs

On this server we have found a single log /var/log/btmp that is 532Mb.

Delete Server Logs Over 10Mb

find /var/log/* -size +10M -exec rm -f {} \;

Find Mail Logs Over 10Mb

find /usr/local/psa/var/log/* -size +10M -exec ls -lh {} \; | awk '{print $5 , $9}'

linux_diskmaillogs

On this server we have found just over 120Mb of mail logs.

Delete Mail Logs Over 10Mb

find /usr/local/psa/var/log/* -size +10M -exec rm -f {} \;

Show disk usage for each site

du -sm /var/www/vhosts/*/httpdocs | sort -rn

linux_diskpersite

This server is hosting just under 2Gb of non-secure site content.

On this server we have managed to free just over 2.5Gb

df -h

linux_diskusagenow


Was this answer helpful?

« Back