系统相关
首页 > 系统相关> > Shell脚本--磁盘空间有超过80%时发信息

Shell脚本--磁盘空间有超过80%时发信息

作者:互联网

df -h | awk '{gsub("\\%","")}NR>1{print $5}'>/var/log/diskused.log
for a in 'cat /var/log/diskused.log'
do
if [ "$a" > "80" ]
then
echo "disk used>80%"
rm -rf /var/log/diskused.log
else
continue
fi
done

标签:diskused,Shell,log,--,80%,echo,时发,gsub,var
来源: https://www.cnblogs.com/josn1984/p/14481184.html