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

posted @ 2021-03-04 16:27  Tnu  阅读(223)  评论(0编辑  收藏  举报