Page 1 of 1

disk quota

Posted: Wed Mar 21, 2018 9:18 am
by nhdesign
On sh is there a script I can run at the command line that will tell me my current usage?
Since Bolt left I keep wanting to refer to the new as Nut.
bolt.shell.net and nut.shell.net

--
vic

Re: disk quota

Posted: Wed Mar 21, 2018 1:35 pm
by patty1
Quota (as in your subject line) or usage (as in your body text)?

For the latter, all the standard UNIX commands should work; are you finding some that you've used on bolt that aren't working on sh? I just tried "du" and it was fine on both systems.

Re: disk quota

Posted: Wed Mar 21, 2018 1:42 pm
by nhdesign
But du only does the current directory. I have an old script
that used to work, and I have tried to modify it. I cannot get a
number to match that found on the sonic quota page so I must be
ignorant of some links, or paths.

--
Vic

Re: disk quota

Posted: Wed Mar 21, 2018 1:53 pm
by nhdesign
#!/bin/sh
#disk-check
#frankb@sonic.net


ME=`whoami`
GRAYMAIL=`/opt/protect/bin/get_graymail_dir`

# dcgi=`du -sm /usr/local/lib/httpd/cgi-bin/$ME | awk '{ printf("%8s \n", $1)}'`
#dreal=`du -sm /nfs/media/$ME | awk '{ printf("%8s \n", $1)}'`
dgray=`du -sm $GRAYMAIL | awk '{ printf("%8s \n", $1)}'`
dmail=`du -sm $MAIL | awk '{ printf("%8s \n", $1)}'`
dwww=`du -sm /home/WWW_pages/$ME | awk '{ printf("%8s \n", $1)}'`
dftp=`du -sm /home/ftp/pub/users/$ME | awk '{ printf("%8s \n", $1)}'`


dhome=`du -sm $HOME | awk '{ printf("%8s \n", $1)}'`
echo
#echo "cgi: $dcgi"
#echo "reala: $dreal"
echo "gray: $dgray"
echo "mail: $dmail"
echo "www: $dwww"
echo "ftp: $dftp"

echo "home: $dhome"
echo "-----------------"

#echo "Total = `expr $dcgi + $dreal + $dgray + $dmail + $dwww + $dftp + $dhome`"
#echo "Total = `expr $dgray + $dmail + $dwww + $dftp + $dhcp + $dztp + $dhome` MB"
echo "Total = `expr $dgray + $dmail + $dwww + $dftp + $dhcp + $dztp + $dhome` MB"
echo "quota = 5GB/5000 MB"

Re: disk quota

Posted: Wed Mar 21, 2018 5:48 pm
by scott
nhdesign wrote:On sh is there a script I can run at the command line that will tell me my current usage?
Since Bolt left I keep wanting to refer to the new as Nut.
bolt.shell.net and nut.shell.net

--
vic
Not yet, but there will be. :)

-Scott

Re: disk quota

Posted: Tue Mar 27, 2018 3:12 pm
by scott
scott wrote:
nhdesign wrote:On sh is there a script I can run at the command line that will tell me my current usage?
Since Bolt left I keep wanting to refer to the new as Nut.
bolt.shell.net and nut.shell.net

--
vic
Not yet, but there will be. :)
Haven't forgotten about this.

We're probably going to query our quota system to get the numbers, rather than running "du" on the files.

-Scott