Created
February 24, 2017 10:28
-
-
Save xorenio/566eda2b9931d2a0478c3ab66bd4e458 to your computer and use it in GitHub Desktop.
Bash available space check
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# for file sizes | |
# 19456000 = 19GB | |
# Random find on hard drive might not work | |
SPACE= df -P . | tail -1 | awk 'CHECK=$4'; | |
S=df -P $PWD | awk 'NR==2{print $4}' | |
echo $S; | |
#echo $SPACE; | |
#SPACE2='100'; | |
if [ $SPACE -lt '19372299' ]; then | |
echo ''; | |
echo 'We are running out of space under '; | |
else | |
echo 'we all good on space'; | |
fi | |
exit 1; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment