[Haifux] SVN quota [(kind of) SOLVED]

Shahar Dag dag at cs.technion.ac.il
Tue Jan 19 17:04:37 MSK 2010


Hello

Well I had several options:
1. write a cron-job that will email users if they are above quota threshold
2. write a login shell that will report the quota & exit
3. write some cgi script that will allow user via dynamic web page to check his quota
4. write a cron-job that creates a web page that display the quota for all SVN projects (and that what I did)

and here it is with minor changes

#!/bin/bash

out=quota.html

function my_quota()
{
    q=`quota -g $2 | tail -1 -`

    b=`echo $q | awk '{print ($2) }' -`
    l=`echo $q | awk '{print ($3) }' -`
    hl=`echo $q | awk '{print ($4) }' -`
    g=`echo $q | awk '{print ($5) }' -`

    echo "<tr align=\"right\"><td>$1</td><td>$b</td><td>$l</td><td>$hl</td><td>$g</td></tr>" >> $out
}

echo -e "<HTML>\n<HEAD>\n\t<title>cs234311 SVN quota</title>\n</HEAD>\n\n<BODY>\n<table width=\"40%\">" > $out
echo "<tr align=\"right\"><td>group</td><td>blocks</td><td>quota</td><td>limit</td><td>grace</td></tr>" >> $out

my_quota 1 g1
my_quota 2 g2

echo -e "\n</table>\n</BODY>\n</HEAD>" >> $out

chmod 644 $out
# end of script

Shahar


  ----- Original Message ----- 
  From: Shahar Dag 
  To: Haifaux 
  Sent: Monday, January 18, 2010 9:25 AM
  Subject: [Haifux] SVN quota


  Hello

  I have a LINUX server (RHE 4) that among other things serves as SVN server (the SVN server runs over apache).
  Users can access their repository via https, but they can't login to the server (not even with ssh).
  To access the SVN, users must supply their NIS user name & password.
  Every SVN repository has it's own quota limitation.

  The question is: do SVN users have any way to test their quota?
  (I don't want to write a cron job that warns the users when they are over 80% of the quota)

  Thanks
  Shahar


------------------------------------------------------------------------------


  _______________________________________________
  Haifux mailing list
  Haifux at haifux.org
  http://hamakor.org.il/cgi-bin/mailman/listinfo/haifux
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://haifux.org/pipermail/haifux/attachments/20100119/4f24c8db/attachment.html 


More information about the Haifux mailing list