Skip to content

Instantly share code, notes, and snippets.

@azat
Last active August 29, 2015 14:01
Show Gist options
  • Save azat/82604878cdad436a4f1c to your computer and use it in GitHub Desktop.
Save azat/82604878cdad436a4f1c to your computer and use it in GitHub Desktop.
diskToTrack=/
pidToStop=$(pgrep sort)
leftPercents=97
while [ 1 ] ; do if [[ $(df $diskToTrack | tail -n+2 | awk '{sub(/%/,"",$5); print $5}') -gt $leftPercents ]]; then kill -STOP $pidToStop && break; else sleep 30; fi; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment