#!/bin/bash

####
##  Desc    diskalert.sh
##  Auth    [email protected]
##  Date    20190919
##  Usage   bash diskalert.sh
####

if [ `whoami` != cad ]
then 
    echo "pls run as cad user"
    exit 0
fi  

# while version

while :
do
    used=$(df -hT / | tail -n 1 | awk '{print $6}' | awk -F% '{print $1}')
    if [ $used -lt 80 ]
    then
        echo "$HOST this disk will be full"
    fi  
    sleep 3600
done