#!/bin/bash
read -t 30 -p "请输入您想要查找那个分区(格式sda1~sda3):" aaa
number=$(df -h | grep $aaa | awk ‘{print $5}‘ | cut -d "%" -f 1)
if [ $number -ge "70" ]
then
echo "情况不正常,已经将邮件发送到您的邮箱内"
echo "小心,您的分区已经超越了阈值,请及时清理"|mutt -s "告警" [email protected]
else
echo "情况很正常,请不用担心"
fi
时间: 2024-10-24 22:21:37