Skip to content

Instantly share code, notes, and snippets.

@laoshuterry
Created October 31, 2015 09:53
Show Gist options
  • Save laoshuterry/647154b21868fc600ebd to your computer and use it in GitHub Desktop.
Save laoshuterry/647154b21868fc600ebd to your computer and use it in GitHub Desktop.
#!/bin/bash
#硬盘使用率报警
Rate=`df -h|grep /dev/sda5|awk '{print $5}'|cut -f 1 -d "%"`
#变量如果使用整数判断,不需要双引号
if [ $Rate -ge 90 ];then
echo -e "The filesystem is almost full!\n"
else
echo -e "The system is enough!\n"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment