linux - How to execute command when df -h return 98% full -
how execute command when df -h return 98% full
i have disk
/dev/sdb1 917g 816g 55g 94% /disk1
if return 98% full, following
find . -size +80m -delete
how do it, run shell script using cron
* * * * * sh /root/checkspace.sh
execute df -h
, pipe command output grep
matching "/dev/sdb1", , process line awk
, checking see if numeric portion of column 5 ($5
in awk
terms) larger or equal 98. don't forget check possibility it's on 98.
Comments
Post a Comment