Skip to content

I need an easy to grab snapshot in time of disk space to monitor

License

Notifications You must be signed in to change notification settings

appatalks/gh_disk_space_check

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

Check Disk Space Script
for GitHub Enterprise Server (GHES)

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).

Features

  • 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).

Getting Started

One-Liner to Run the Script

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)

Optional add to cron

To run the script every 15 minutes as the "admin" user, follow these steps:

  1. 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
  2. Open the crontab for the admin user:

    crontab -e
  3. 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!!

Author

  • appatalks

Credit

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

License

This project is licensed under the GPL-3.0 license.

About

I need an easy to grab snapshot in time of disk space to monitor

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages