Created
July 27, 2021 13:20
-
-
Save DrizzlyOwl/78186cda92fa849119cbd3f35f0df7fb to your computer and use it in GitHub Desktop.
diskme.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# | |
# Author: Ash Davies | |
# Description: Analyse disk space usage per directory within the apache document root. | |
# Useful for running on a cron job to monitor directory sizes. | |
host=$(hostname) | |
apachedir="/var/www/vhosts" | |
echo "Server name: $host" | |
lsb_release -d | |
echo "" | |
df -h $apachedir | |
echo | |
du -sh $apachedir | |
echo ""; | |
for d in $apachedir/*/ ; | |
do ( | |
du -hs "$d" | |
); | |
done | sort -hr |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment