From:	MERC::"uunet!CRVAX.SRI.COM!RELAY-INFO-VAX"  4-JUN-1992 19:53:14.82
To:	INFO-VAX@SRI.COM
CC:	
Subj:	Quota monitor and Cleaning program

Hello,

	Recently I mentioned that I was working on a program to help
monitor quota situations with many users(many computer illiterate) and
a lot of mail. I received mail asking me to quit teasing you and post
the program. Here it is. It is simple and straight forward, but it does
the job.





$!
$! CLEANUP.COM
$!
$!+----------------------------------------------------------+
$!|           CLEANUP Quota Allocation Version 2.0           |
$!+----------------------------------------------------------+
$!
$!Programmed by Deva Winblood 6/3/1992     VIE_MANAGER@WSC.COLORADO.EDU
$!                             VMS 5.5
$!
$!
$D_E == "DELETE/ERASE"
$WO == "WRITE SYS$OUTPUT"
$CIO == "CLOSE IO"
$PD$ = F$DIRECTORY()           ! Present Directory calling from
$MOVE SYS$LOGIN                ! MOVE symbol subs. for SET DEFAULT
$OD$ = F$DIRECTORY()           ! Outer Most User Owned Directory
$!
$DASHED = "+-------------------------------------------------+"
$WO DASHED
$WO "| ACCOUNT Quota Conservation and Cleaning Program |"
$WO "|                Version 2.0                      |"
$WO DASHED
$!
$SET NOON                      ! Disable Error checking.
$WD$ = ""                      ! Work Directory
$WD$ = PD$
$GOSUB _CLEANIT
$if PD$ .eqs. OD$ then goto _SKIPCLEAN2
$WD$ = OD$
$GOSUB _CLEANIT
$_SKIPCLEAN2:
$WO DASHED
$WO "| ACCOUNT CLEANING PROGRAM IS FINNISHED CLEANING  |"
$WO DASHED
$EXIT
$!
$_CLEANIT:
$WO "Entering directory>",WD$
$MOVE 'WD$'
$A$ = ""            ! For F$SEARCH()
$A$ = F$SEARCH("*.JOU")
$IF A$ .eqs. "" then goto _SKIPJOU
$WO "Do you mind if I delete files ending with the .JOU sufix?"
$GOSUB _QUERY
$IF Q$ .eqs. "N" then D_E *.JOU;*
$_SKIPJOU:
$A$ = F$SEARCH("*.OBJ")
$IF A$ .eqs. "" then goto _SKIPOBJ
$WO "Do you mind if I delete files ending with the .OBJ sufix?"
$GOSUB _QUERY
$IF Q$ .eqs. "N" then D_E *.OBJ;*
$_SKIPOBJ:
$A$ = F$SEARCH("*.LIS")
$IF A$ .eqs. "" then goto _SKIPLIS
$WO "Do you mind if I delete files ending with the .LIS sufix?"
$gosub _QUERY
$if Q$ .eqs. "N" then D_E *.LIS;*
$_SKIPLIS:
$A$ = F$SEARCH("*.OLD")
$IF A$ .eqs. "" then GOTO _SKIPOLD
$WO "Do you mind if I delete files ending with the .OLD sufix?"
$GOSUB _QUERY
$IF Q$ .eqs. "N" then D_E *.OLD;*
$_SKIPOLD:
$A$ = F$SEARCH("*.TMP")
$IF A$ .eqs. "" then goto _SKIPTMP
$WO "Do you mind if I delete files ending with the .TMP sufix?"
$GOSUB _QUERY
$IF Q$ .eqs. "N" then D_E *.TMP;*
$_SKIPTMP:
$A$ = F$SEARCH("MAIL.TXT")
$IF A$ .nes. "" then gosub _MMSIZECHK
$A$ = F$SEARCH("MAIL.MAI")
$IF A$ .nes. "" then gosub _MAILSIZECHK
$RETURN
$!
$_MMSIZECHK:
$dir mail.txt/output=CLEANUP.TMP
$open/read io CLEANUP.TMP
$_MMLOOP:
$N = 0
$READ/END_OF_FILE=_MMEOF IO A$
$n = F$INTEGER(F$EXTRACT(23,5,A$))
$if n .gt. 0 then goto _MMEOF
$GOTO _MMLOOP
$_MMEOF:
$CIO
$D_E CLEANUP.TMP;*
$if n .lt. 100 then return
$WO "NOTICE: Your mail.txt file(Multi-Mail) is ",n," BLOCKS in size."
$WO "  This is considered a quota glutton. There are several actions you can"
$WO "  take to alleviate this problem."
$WO "  #1) Delete all messages that you do not absolutely have to keep."
$WO "  #2) Print out the messages that you wish to keep and delete the computer"
$WO "     based copy. RECYCLE unused paper."
$RETURN
$!
$_MAILSIZECHK:
$dir MAIL.MAI/output=CLEANUP.TMP
$open/read io CLEANUP.TMP
$_MAILLOOP:
$N = 0
$READ/END_OF_FILE=_MAILEOF IO A$
$n = F$INTEGER(F$EXTRACT(23,5,A$))
$if n .gt. 0 then goto _MAILEOF
$GOTO _MAILLOOP
$_MAILEOF:
$CIO
$D_E CLEANUP.TMP;*
$IF n .lt. 100 then return
$WO "NOTICE: Your MAIL.MAI file(MAIL>) is ",n," BLOCKS in size. This is much"
$WO "	larger than is neccessary. There are three things you can do to reduce"
$WO "   the size of your mail file."
$WO "#1) Delete all mail messages that are not absolutely neccessary. You can"
$WO "	do this by typing DELETE at the MAIL> prompt after reading a message."
$WO "#2) Messages that you do need to keep you may want to consider printing"
$WO "	out. Then you can delete the computer versions. RECYCLE unused paper."
$WO "#3) Type COMPRESS at the MAIL> prompt this will make your mail file smaller"
$WO "	but, it will still function normally. This process creates a file called"
$WO "	MAIL.OLD. It is ok to delete this file.
$RETURN
$!
$_QUERY:
$Q$ = ""
$INQUIRE Q$/NOPUN "(Y/N)>"
$Q$ = F$EXTRACT(0,1,Q$)
$IF Q$ .nes. "Y" .and. Q$ .nes. "N" then goto _QUERY
$RETURN


+-------------------------------------------------------------------------+
| Deva Winblood(Dayva Wineblood) | VIE_MANAGER@WSC.COLORADO.EDU           |
|                                | STU521530304@WSC.COLORADO.EDU          |
|                                | DWINBLOO@HEARTLAND.BRADLEY.EDU         |
|                                | BG556@CLEVELAND.FREENET.EDU            |
+-------------------------------------------------------------------------+

