#!/bin/bash # ———————————————————————- # mikes handy rotating-filesystem-snapshot utility # ———————————————————————- # this needs to be a lot more general, but the basic idea is it makes # rotating backup-snapshots of /home whenever called # ———————————————————————- unset PATH # suggestion from…
Category: Shell Scripts
Disk Usage
#!/bin/sh # set -x # Shell script to monitor or watch the disk space # It will send an email to $ADMIN, if the (free available) percentage of space is >= 90%. # ————————————————————————- # Set admin email so that…
Check Disk Space and Sends an Email Alert
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
Checking Server Utilization
Shell Scrip for Checking Server Utilization #!/bin/bash date; echo “uptime:” uptime echo “Currently connected:” w echo “——————–” echo “Last logins:” last -a |head -3 echo “——————–” echo “Disk and memory usage:” df -h | xargs | awk ‘{print “Free/total disk:…