disk quota

Advanced feature discussion, beta programs and unsupported "Labs" features.
6 posts Page 1 of 1
by nhdesign » Wed Mar 21, 2018 9:18 am
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
by patty1 » Wed Mar 21, 2018 1:35 pm
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.
by nhdesign » Wed Mar 21, 2018 1:42 pm
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
by nhdesign » Wed Mar 21, 2018 1:53 pm
#!/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"
by scott » Wed Mar 21, 2018 5:48 pm
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
by scott » Tue Mar 27, 2018 3:12 pm
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
6 posts Page 1 of 1

Who is online

In total there are 25 users online :: 0 registered, 0 hidden and 25 guests (based on users active over the past 5 minutes)
Most users ever online was 999 on Mon May 10, 2021 1:02 am

Users browsing this forum: No registered users and 25 guests