PAC=$1 USER=$2 TEMPFILE=/tmp/${PAC}_du_httpd.txt COUNTFILE=/tmp/${PAC}_httpd_count.txt if [ "$PAC" = "" ]; then echo "call: ./pac-du-httpd.sh tim00" exit fi if [ "$USER" = "" ]; then rm -f $TEMPFILE touch $TEMPFILE chmod a+rw $TEMPFILE # run it for the packet user as well ./pac-du-httpd.sh tim00 ~ >& /dev/null cd ~/users; for USER in *; do sudo -u "$PAC-$USER" ../pac-du-httpd.sh $PAC $USER; done; # summarize the sizes export COUNT=0 cat $TEMPFILE | while read line; do export COUNT=$[$COUNT+`echo $line | cut -f1 --delim " "`]; echo $COUNT > $COUNTFILE; done echo "diskspace used by files that belong to user httpd in your directories in bytes:" cat $COUNTFILE rm $COUNTFILE mv $TEMPFILE ~ echo "see details in ~/"`basename $TEMPFILE` else find $USER -user httpd | while read line; do path="`pwd`/$line"; if [ -f "$path" ]; then du -s "$path" -B 1 >> $TEMPFILE; fi; done fi