Note
This script is independently maintained and is not supported by GitHub.
Use (disk_check.sh
) to quickly monitor disk space usage on a GitHub Enterprise Server (GHES).
- Displays the server time at run time.
- Provides filesystem and inode information.
- Reports the largest directories (to 5 levels deep).
- Reports the largest files and the largest files older than 30 days.
- Excludes some directories from scans, ie. (
/proc
and/data/user/docker/overlay2
).
You can run the script directly from GitHub without cloning the repository. Use the following one-liner:
time bash <(curl -sL https://github.com/appatalks/gh_disk_space_check/raw/main/disk_check.sh)
To run the script every 15 minutes
as the "admin" user, follow these steps:
-
Download the script to
/home/admin
:curl -sL https://github.com/appatalks/gh_disk_space_check/raw/main/disk_check.sh -o /home/admin/disk_check.sh chmod +x /home/admin/disk_check.sh
-
Open the crontab for the
admin
user:crontab -e
-
Add the following line to the crontab:
*/15 * * * * bash /home/admin/disk_check.sh >> /home/admin/disk_check.log 2>&1
This will run the script every 15 minutes and append the output to
/home/admin/disk_check.log
.
Remeber to remove from cron and purge the log when no longer required. Or risk running out of disk space!!
- appatalks
This script was adapted from Rackspace's documentation on troubleshooting low disk space for a Linux cloud server: https://docs.rackspace.com/docs/troubleshooting-low-disk-space-for-a-linux-cloud-server
This project is licensed under the GPL-3.0 license.