Created
November 7, 2011 17:09
-
-
Save zeszyt/1345544 to your computer and use it in GitHub Desktop.
Monitorowanie zajętości partycji
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/ksh | |
max=85 | |
for disc in $(df | awk '{ print $6 }' | sed '1d'); do | |
capacity=$(df $disc | sed '1d' | awk '{ print $5 }' | tr -cd [[:digit:]]) | |
if [ $capacity -gt $max ]; then | |
echo UWAGA! Partycja \"$disc\" jest zajęta w $capacity procentach. | |
fi | |
done |
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
./capacity.sh | |
UWAGA! Partycja "/" jest zajęta w 7 procentach. | |
UWAGA! Partycja "/usr" jest zajęta w 25 procentach. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment