- touch ME/shell/df.sh
- chmod +x ME/shell/df.sh
- vim ME/shell/df.sh
#!/bin/bash
#分区使用率
rate=$(df -h | grep '/dev/disk1s1' | awk '{print $5}' | cut -d % -f 1)
if [ $rate -ge 80 ]
then
echo "warning,硬盘空间使用率高达 ${rate}%,请清理!"
fi
#!/bin/bash
#分区使用率
rate=$(df -h | grep '/dev/disk1s1' | awk '{print $5}' | cut -d % -f 1)
if [ $rate -ge 80 ]
then
echo "warning,硬盘空间使用率高达 ${rate}%,请清理!"
fi