您的位置:首页 > 运维架构 > Shell

监视磁盘空间shell脚本

2006-10-09 10:19 429 查看
监视磁盘hda1

#!/bin/sh
# disk_mon
# monitor the disk space
# get percent column and strip off header row from df
LOOK_OUT=0
until [ "$LOOK_OUT" -gt "90" ]
do
LOOK_OUT=`df | grep /hda1 | awk '{print $5}' | sed 's/%//g'`
echo $LOOK_OUT%
sleep 1
done

echo "Disk hda1 is nearly full!"
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: