Skip to content

Instantly share code, notes, and snippets.

@zeszyt
Created November 7, 2011 17:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zeszyt/1345544 to your computer and use it in GitHub Desktop.
Save zeszyt/1345544 to your computer and use it in GitHub Desktop.
Monitorowanie zajętości partycji
#!/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
./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