Skip to content

GEEKDECODER

Linux, Windows, Software Tips, Articles and Hacks

  • Services
  • Support
  • Contact
  • About
  • Crypto Quotes

Search for Articles

Search for:

Featured Articles

  • How to Remove You do not have a valid subscription for this server on Proxmox version 7.1-8
  • How to Switch Desktop Environments in Ubuntu/Debian From the Command Line
  • NetworkManager
  • Install and Configure fail2ban on Debian 11
  • ApacheSolr vulnerability CVE-2021-44228 for Log4j
  • Install Proxmox VE on Debian 11 Bullseye 3 Node Cluster with Ceph
  • Display Linux logo with hardware Info using screenfetch
  • Install and Setup ClamAV on Debian 11
  • Remove Nginx
  • Install MySQL, Nginx and Zabbix on Debian 11

Categories

Check Disk Space and Sends an Email Alert

February 24, 2016 The Geek Decoder Leave a comment Shell Scripts
MAX=95
EMAIL=USER@domain.com
PART=sda1
USE=`df -h |grep $PART | awk '{ print $5 }' | cut -d'%' -f1`
if [ $USE -gt $MAX ]; then
  echo "Percent used: $USE" | mail -s "Running out of disk space" $EMAIL
fi

Post navigation

← Checking Server Utilization
Disk Usage →

Copyright 2021 Geekdecoder, LLC. All Rights Reserved.