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

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -