#!/usr/local/bin/bash # # some quota checking nonsense when quotas don't work! # # # # Zoidial, Inc. # Eric Thern # # # # something possibly for the future? Neat idea if you have more than one set of # mailfiles or the user owns more files elsewhere (also can be used for /tmp or something) # # find /var -user $user -print -exec ls -la {} \; | grep " $user" |awk '{print $5}' # for user in `cat /etc/passwd |grep "/home/" | cut -f1 -d:` do quota=$( repquota -u /home |grep "$user " | awk '{print $4}' ) mailspace=$( if test -a /var/mail/$user then ls -las /var/mail/$user | grep " $user" |awk '{print $1}' else echo "0" fi) homedir=$( if test -d /home/$user then du -s /home/$user | awk '{print $1}' else echo "0" fi) allquota=$( expr $homedir + $mailspace ) available=$( expr $quota - $allquota ) echo "$user has $available quota available" #echo "$user $quota $mailspace $homedir $allquota $available" echo "-------------------------------------------------" done