home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / os / vms / 14254 < prev    next >
Encoding:
Internet Message Format  |  1992-08-29  |  4.0 KB

  1. Path: sparky!uunet!cis.ohio-state.edu!ucbvax!CSVAX1.UCC.IE!chris
  2. From: chris@CSVAX1.UCC.IE ("J.C. Higgins, Sys Mgr CsVax1, UCC , Eire")
  3. Newsgroups: comp.os.vms
  4. Subject: RE: Disk quota report facility wanted?
  5. Message-ID: <0095FB9E.2D483840.30505@CSVAX1.UCC.IE>
  6. Date: 27 Aug 92 18:33:51 GMT
  7. Sender: daemon@ucbvax.BERKELEY.EDU
  8. Distribution: world
  9. Organization: The Internet
  10. Lines: 109
  11.  
  12. I stuck together the following little routine to do part of what you need.
  13. It's not very fast, but it does the job.
  14. It reports the name of users who have used over 90% of their diskquota.
  15. This also includes people who have exceeded their quota..
  16. As for a top ten listing, won't that always be your top ten most important
  17. users. I mean that SYSTEM should be close to the top... Then the local
  18. system programmer.. etc... So if you want to filter that information you
  19. could modify the following routine..
  20.  
  21.                                                   Chris.
  22.  
  23. + J.C. Higgins, Sys Admin  +  If you love something, set it free. If it doesn't
  24. + CHRIS@csvax1.ucc.ie      +  come back to you, hunt it down and KILL it. If
  25. + SCCS6002@iruccvax.ucc.ie +  that doesn't work, then GIVE UP peacefully.
  26.  
  27. $! QUOALL
  28. $! ------
  29. $! Routine to list ALL users that have used more than 90% of their disk quota
  30. $       v = 'f$VERIFY(0)'
  31. $
  32. $       SET ON
  33. $       ON CONTROL_Y THEN GOTO ABORT
  34. $
  35. $       prev_priv = F$SETPRV("SYSPRV")
  36. $       test = F$PRIVILEGE("SYSPRV")
  37. $       IF test .NES. "TRUE" THEN GOTO NOT_AUTHORIZED
  38. $
  39. $       vmsquotafile = "userquota.list"
  40. $       say   = "WRITE SYS$OUTPUT"
  41. $
  42. $!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  43. $  USER     = ""
  44. $  QUOTA    = 0
  45. $  MAXQUOTA = 0
  46. $  DISKQUOTA := $DISKQUOTA
  47. $  DEFINE/USER sys$output 'vmsquotafile'
  48. $  DiskQuota
  49.           sho *
  50.      exit
  51. $
  52. $       OPEN /READ /ERROR=ABORT  quofile  'vmsquotafile'
  53. $
  54. $! Skip DISKQUOTA header.
  55. $       READ/END=DONE /ERR=ERRORS  quofile  record
  56. $
  57. $       say "   User               Quota     MaxQuota"
  58. $
  59. $LOOP:
  60. $       READ/END=DONE /ERR=ERRORS  quofile  record
  61. $       user = f$EXTRACT(0,17,record)
  62. $       temp = f$integer(f$extract(18,1,record))
  63. $       if ((temp .eq. 0) .and. (f$extract(18,1,record) .nes. "0")) then goto SK
  64.    PLN
  65. $       if ((temp .ge. 0) .and. (temp .le. 9)) then goto LBRK
  66. $SKPLN:
  67. $       READ/END=DONE /ERR=ERRORS  quofile  record
  68. $LBRK:
  69. $       quota = f$INTEGER(F$EXTRACT(18,10,record))
  70. $       maxquota = f$INTEGER(F$EXTRACT(31,10,record))
  71. $       IF (quota * 10) .LE. (maxquota * 9)  THEN GOTO LOOP
  72. $       say user, "     ", quota , "        " , maxquota
  73. $       GOTO LOOP
  74. $
  75. $!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  76. $ERRORS:
  77. $       say ""
  78. $       say "??? problems reading file ", vmsquotafile
  79. $       say ""
  80. $       GOTO ABORT
  81. $
  82. $!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  83. $NOT_AUTHORIZED:
  84. $       say " "
  85. $       say " !!! Sorry - you do not have the required privilege."
  86. $       say " "
  87. $
  88. $!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  89. $ABORT:
  90. $!      GOTO DONE
  91. $
  92. $!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  93. $DONE:
  94. $       IF f$TRNLNM("quofile") .NES. "" THEN CLOSE quofile
  95. $       delete/nolog/noconf 'vmsquotafile';*
  96. $       prev_priv = F$SETPRV(prev_priv)
  97. $       EXIT 1.OR.f$VERIFY(v)
  98. $
  99. $!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  100. $HELP:  TYPE SYS$INPUT
  101.  
  102. QUOALL
  103. ******
  104.  
  105. Routine to list ALL users that have used more than 90% of their diskquota.
  106.  
  107. Usage
  108.         @QUOALL
  109.                 Lists the Quota status for ALL users on the screen
  110.  
  111.  
  112. $       EXIT 1.OR.f$VERIFY(v)
  113. $
  114. $!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  115. $ J.C. Higgins (16-5-92) University College Cork. <chris@csvax1.ucc.ie>
  116. $ This program is mine, the format of the COM file is one
  117. $ used by 'the GODs upstairs'. The top 'GOD' being  J.F. Murphy.
  118. $ Did I say GOD,.. should that be DOG ?? Well who knows...
  119. $!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
  120.  
  121.