User Tools

Site Tools


kurs:mydf.sh
#!/bin/bash



## IFS=$'\n'
HEAD=0

df -k | while read FS BLOCKS USED AVAILABLE USEP MOUNT
 do
 if [ $HEAD -ne 1 ]; then
   HEAD=1
   continue
 fi
 USED_PROZ=` echo "scale=3; $USED * 100 / $AVAILABLE" | bc `
##  echo -n "$MOUNT $USED_PROZ"
 USEP=`echo $USEP | sed 's/%//' `
 printf "% 20s [%02.02f] [%02g]\n" $MOUNT $USED_PROZ $USEP
 if [ $USEP -gt 90 ]; then
   echo ACHTUNG
 fi
 done
kurs/mydf.sh.txt · Last modified: 2014/09/10 21:22 (external edit)