Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1202284
  • 博文数量: 275
  • 博客积分: 6445
  • 博客等级: 准将
  • 技术积分: 2863
  • 用 户 组: 普通用户
  • 注册时间: 2006-03-04 23:22
文章分类

全部博文(275)

文章存档

2024年(2)

2023年(5)

2022年(3)

2021年(18)

2020年(9)

2019年(1)

2018年(13)

2017年(11)

2015年(9)

2013年(2)

2012年(4)

2011年(24)

2010年(114)

2009年(6)

2008年(29)

2007年(13)

2006年(10)

我的朋友

分类: LINUX

2010-06-04 10:47:45

#!/bin/sh

#make by itbit

init()
{
IPADD=`ifconfig|grep 172.18|awk '{print $2}'|sed 's/addr://g'`;
NOWTIME=`date +%F-%H:%M`;
MAILTO="";
MAIL_SUB=" !**Report - Disk Capacity Report $NOWTIME **!";
tmpfile=/tmp/iamatmpfile.tmp
}

mhead()
{
echo "" >$tmpfile;
echo "From :$IPADD" >>$tmpfile
echo "State :Report" >>$tmpfile
echo "ReportBy:$0" >> $tmpfile
echo "DateTime:$NOWTIME" >> $tmpfile
echo "Info :codfei" >> $tmpfile
echo "" >>$tmpfile;
}

smail()
{
mail -s "$MAIL_SUB" $MAILTO < $tmpfile

}
init;

for x in `df | grep /dev | awk '{print $5}' | sed 's/%//g'`
do

if [ $x -gt 89 ]; then
mhead;
df -h >>$tmpfile;
smail;
exit 0;
fi

done
阅读(1889) | 评论(0) | 转发(0) |
0

上一篇:为什么你富不起来

下一篇:脚本加密

给主人留下些什么吧!~~