shell/检测分区使用率是否过高.txt

10 lines
225 B
Bash
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/usr/bin/bash
#
#by fuxiaoshun 4/1
time=`date +%F-%T`
a=`df -h | awk NR==6'{print $5}'`
if [ ${a%\%*} -ge 1 ];then
echo "$time告警/分区使用不足" >>/tmp/1.txt
else
echo "/分区内存足够"
fi