当前位置: 代码迷 >> 综合 >> 分区使用率
  详细解决方案

分区使用率

热度:1   发布时间:2024-02-12 17:36:37.0
  • 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  ]thenecho "warning,硬盘空间使用率高达 ${rate}%,请清理!"
fi

 

  相关解决方案