From: jonathan@ucsvc.ucs.unimelb.edu.au
Newsgroups: news.software.anu-news
Subject: NEWSSKIM_ALT.5-OF-7
Date: 15 Oct 92 03:09:41 GMT
Organization: The University of Melbourne

-+-+-+-+-+-+-+-+ START OF PART 5 -+-+-+-+-+-+-+-+
X$`20`20`20purge`20`20/nolog`20/keep=40`09`09`20`20`20`20`20`20`20NEWS_MANAGER:
VNNTP_*.LOG
X$`20`20`20set`20message`20'msgs'
X$`20`20`20set`20on
X$`20endif
X$
X$`20RETURN
X$
X$!----------------------------------------------------------------------------
V--
X$!`20`20Convert`20the`20News`20database`20files`20to`20optimize`20their`20stru
Vcture.`20`20This`20routine
X$!`20`20contains`20SITE-SPECIFIC`20global`20buffer`20allocations`20and`20file
V`20extensions.
X$
X$DO_CONVERT_DB:
X$
X$`20gosub`20`20Check_Stop
X$`20if`20Disk_Space_Problem`20`20then`20`20RETURN
X$
X$`20if`20Force_Convert`20`20then`20`20goto`20`20CONVERTER
X$
X$`20Weekday`20=`20f$edit`20(f$extract`20(0,3,f$cvtime`20(,"ABSOLUTE","WEEKDAY"
V)),"UPCASE")
X$`20Weekday`20=`20f$locate`20(Weekday,"MONTUEWEDTHUFRISATSUN")`20/`203
X$`20Hour_Now`20=`20f$cvtime`20(,"ABSOLUTE","HOUR")
X$`20if`20(Weekday`20.le.`204)`20.and.`20-`09`09`09`09!`20i.e.`20Mon-Fri.
X`20`20`20`20`20(Hour_Now`20.lt.`20Earliest_Convert)`20.and.`20-`09`09!`20`20an
Vd
X`20`20`20`20`20(Hour_Now`20.ge.`20Latest_Convert)`09`09`09!`20we're`20in`20pri
Vme`20time.
X$`20then
X$`20`20`20Convert_db`20`20`20`20=`200
X$`20`20`20Compress_Mail`20=`200
X$`20`20`20Report_Junk`20`20`20=`200
X$`20`20`20RETURN
X$`20endif
X$
X$CONVERTER:
X$`20say`20"%Converting`20news`20database`20at`20''f$time()'"
X$
X$`20Force_Convert`20=`20`200`09`09!`20Done`20-`20no`20matter`20success`20or
V`20otherwise`20!
X$`20Convert_Db`20`20`20`20=`20`200`09`09!`20Ditto
X$`20db_file`20=`20""
X$`20on`20warning`20`20then`20`20goto`20`20FAILED_CONVERT
X$
X$`20sysman`20do`20define`20/system`20/executive`20NEWS_STOP`20ALLOW_MAIL`09!
V`20Shutdown`20NEWS.
X$`20wait`2000:05:00`09`09`09!`20Give`20it`20a`20little`20time.
X$`20if`20Blat_Em`20`20then`20`20gosub`20`20BLAT_NEWS_USERS
X$
X$`20say`20"%Converting`20NEWS`20GROUPS`20file`20at`20''f$time()'"
X$`20set`20file`20/log`20/extension=256`20/global_buffer=16`20`20`20`20`20NEWS_
VROOT:NEWS.GROUPS
X$`20analyze`20/rms`20/fdl`20/output=NEWS_ROOT:NEWSGROUPS.FDL`20NEWS_ROOT:NEWS.
VGROUPS
X$`20edit`20/fdl`20/nointer`20/analyze=NEWS_ROOT:NEWSGROUPS.FDL`20NEWS_ROOT:NEW
VSGROUPS.FDL
X$`20db_file`20=`20"NEWS_ROOT:NEWS.GROUPS"
X$`20convert`20/statistics`20/fdl=NEWS_ROOT:NEWSGROUPS`20-
X`09NEWS_ROOT:NEWS.GROUPS`20`20NEWS_ROOT:NEWS.GROUPS_NEW
X$`20db_file`20=`20""
X$`20rename`20/log`20NEWS_ROOT:NEWS.GROUPS_NEW`20`20NEWS_ROOT:NEWS.GROUPS;
X$`20set`20file`20/log`20/extension=256`20/global_buffer=16`20NEWS_ROOT:NEWS.GR
VOUPS
X$`20purge`20/log`20NEWS_ROOT:NEWS.GROUPS
X$`20delete`20/nolog`20NEWS_ROOT:NEWSGROUPS.FDL;*
X$
X$`20say`20"%Converting`20NEWS`20HISTORY`20file`20at`20''f$time()'"
X$`20set`20file`20/log`20/extension=8192`20/global_buffer=64`20NEWS_ROOT:HISTOR
VY.V60
X$`20analyze`20/rms`20/fdl`20/output=NEWS_ROOT:HISTORY.FDL`20NEWS_ROOT:HISTORY.
VV60
X$`20edit`20/fdl`20/nointer`20/analyze=NEWS_ROOT:HISTORY.FDL`20NEWS_ROOT:HISTOR
VY.FDL
X$`20db_file`20=`20"NEWS_ROOT:HISTORY.V60"
X$`20convert`20/statistics`20/fdl=NEWS_ROOT:HISTORY`20-
X`09NEWS_ROOT:HISTORY.V60`20`20NEWS_ROOT:HISTORY.V60_NEW
X$`20db_file`20=`20""
X$`20rename`20/log`20NEWS_ROOT:HISTORY.V60_NEW`20`20NEWS_ROOT:HISTORY.V60;
X$`20set`20file`20/log`20/extension=8192`20/global_buffer=64`20NEWS_ROOT:HISTOR
VY.V60
X$`20purge`20/log`20NEWS_ROOT:HISTORY.V60
X$`20delete`20/nolog`20NEWS_ROOT:HISTORY.FDL;*
X$
X$`20say`20"%Converting`20NEWS`20ITEMS`20file`20at`20''f$time()'"
X$`20set`20file`20/log`20/extension=10240`20/global_buffer=64`20`20NEWS_ROOT:NE
VWS.ITEMS
X$`20analyze`20/rms`20/fdl`20/output=NEWS_ROOT:NEWSITEMS.FDL`20NEWS_ROOT:NEWS.I
VTEMS
X$`20edit`20/fdl`20/nointer`20/analyze=NEWS_ROOT:NEWSITEMS.FDL`20NEWS_ROOT:NEWS
VITEMS.FDL
X$`20db_file`20=`20"NEWS_ROOT:NEWS.ITEMS"
X$`20convert`20/statistics`20/fdl=NEWS_ROOT:NEWSITEMS`20-
X`09NEWS_ROOT:NEWS.ITEMS`20`20NEWS_ROOT:NEWS.ITEMS_NEW
X$`20db_file`20=`20""
X$`20rename`20/log`20NEWS_ROOT:NEWS.ITEMS_NEW`20`20NEWS_ROOT:NEWS.ITEMS;
X$`20set`20file`20/log`20/extension=10240`20/global_buffer=64`20NEWS_ROOT:NEWS.
VITEMS
X$`20purge`20/log`20NEWS_ROOT:NEWS.ITEMS
X$`20delete`20/nolog`20NEWS_ROOT:NEWSITEMS.FDL;*
X$
X$!`20Success:`20update`20last`20convert`20day`20number.
X$
X$`20say`20"%Convert`20of`20NEWS`20database`20completed`20successfully`20at`20'
V'f$time()'"
X$`20close`20/nolog`20stamp
X$`20open`20/write`20stamp`20NEWS_MANAGER:TIMESTAMP_CONVERT.DAT
X$`20write`20stamp`20day_number
X$`20close`20/nolog`20stamp
X$`20purge`20/nolog`20NEWS_MANAGER:TIMESTAMP_CONVERT.DAT
X$
X$`20sysman`20do`20deassign`20/system`20/executive`20NEWS_STOP`09!`20Cancel`20N
VEWS`20Shutdown.
X$
X$`20on`20warning`20`20then`20`20goto`20`20ABORT
X$`20RETURN
X$
X$FAILED_CONVERT:
X$`20status`20=`20$status
X$`20on`20warning`20`20then`20`20goto`20`20ABORT
X$`20say`20"%Convert`20FAILED`20at`20''f$time()'"
X$
X$`20sysman`20do`20deassign`20/system`20/executive`20NEWS_STOP`09!`20Cancel`20N
VEWS`20Shutdown.
X$
X$`20subject`20=`20"%NEWSSKIM`20Alarm:`20CONVERT_DB`20FAILED`20(''f$time()')"
V`20+`20crlf`20+`20-
X`09`20`20`20`20"Error`20status`20was`20''status'`20(''f$message(status)')"
X$`20if`20db_file`20.nes.`20""`20`20then`20`20-
X`20`20`20`20`20subject`20=`20subject`20+`20crlf`20+`20"File`20which`20failed:
V`20`20''db_file'_NEW"
X$`20mail`20NL:`20usenet`20/subject="''subject'"
X$`20if`20f$search`20("NEWS_ROOT:*.FDL")`20.nes.`20""`20`20then`20`20delete`20N
VEWS_ROOT:*.FDL;*
X$
X$`20RETURN
X$
X$!----------------------------------------------------------------------------
V--
X$!`20`20Blat`20any`20users`20of`20NEWS`20(except`20self,`20of`20course).`20
V`20Use`20a`20SITE-SPECIFIC
X$!`20`20program`20which`20simply`20calls`20the`20$FORCEX`20system`20service
V`20to`20do`20this.
X$
X$BLAT_NEWS_USERS:
X$
X$`20blatted`20=`200
X$`20define`20SYS$OUTPUT`20NEWS_MANAGER:BLAT_'Pid'.TMP
X$`20sysman`20do`20show`20device`20/files`20/nosystem`20NEWS_ROOT:
X$`20deassign`20SYS$OUTPUT
X$
X$`20itemfl`20=`20f$trnlnm`20("NEWS_ROOT")
X$`20templn`20=`20f$locate`20("`5B",itemfl)
X$`20itemfl`20=`20f$extract`20(templn,f$length(itemfl)-templn,itemfl)`20+`20"NE
VWS.ITEMS"
X$
X$`20set`20command`20SYS_SYSTEM:FORCEX
X$`20sear`20NEWS_MANAGER:BLAT_'Pid'.TMP`20'itemfl'`20/output=NEWS_MANAGER:BLAH_
V'Pid'.TMP
X$`20close`20/nolog`20blah
X$`20open`20/read`20`20`20blah`20`20NEWS_MANAGER:BLAH_'Pid'.TMP
X$READ_BLAH:
X$`20read`20/error=YECH`20/end=YECH`20blah`20user_rec
X$`20user_rec`20=`20f$extract`20(0,24,user_rec)
X$`20user_pid`20=`20f$extract`20(16,8,user_rec)
X$`20if`20user_pid`20.nes.`20Pid`09`09`09`09!`20BLAT`20!`20...`20but`20not`20us
V
X$`20then
X$`20`20`20say`20"%BLAT-I-ZAP,`20Blat`20NEWS`20user`20at`20''f$time()'`20`20''u
Vser_rec'"
X$`20`20`20set`20noon
X$`20`20`20forcex`20/id='user_pid'
X$`20`20`20blatted`20=`201
X$`20`20`20set`20on
X$`20endif
X$`20goto`20`20READ_BLAH
X$YECH:
X$`20close`20blah
X$`20delete`20/nolog`20NEWS_MANAGER:BLA%_'Pid'.TMP;*
X$`20if`20blatted`20`20then`20`20wait`2000:00:10`09`09!`20Let`20images`20exit.
X$
X$`20RETURN
X$
X$!----------------------------------------------------------------------------
V--
X$!`20`20Compress`20the`20NEWSMGR`20MAIL`20file`20to`20(dramatically)`20improve
V`20efficiency.
X$!`20`20This`20routine`20contains`20a`20SITE-SPECIFIC`20mail`20file`20name.
X$
X$DO_COMPRESS_MAIL:
X$
X$`20if`20Disk_Space_Problem`20`20then`20`20RETURN
X$`20say`20"%Compressing`20the`20NEWSMGR`20MAIL`20file`20at`20''f$time()'"
X$`20Max_Tries`20=`203
X$`20Tries`20=`200
X$`20on`20warning`20`20then`20`20goto`20`20FAILED_COMPRESS
X$
X$COMPRESS_MAIL:
X$`20Retry`20=`200
X$`20set`20noon
X$`20mail
Xcompress
Xexit
X$`20status`20=`20$status
X$`20set`20on
X$
X$`20if`20.not.`20status`09`09`09!`20MAIL`20file`20may`20be`20locked.
X$`20then
X$`20`20`20Tries`20=`20Tries`20+`201
X$`20`20`20if`20Tries`20.lt.`20Max_Tries
X$`20`20`20then
X$`20`20`20`20`20say`20"%Re-trying`20MAIL`20Compression`20at`20''f$time()'"
X$`20`20`20`20`20wait`2000:00:30
X$`20`20`20`20`20Retry`20=`201
X$`20`20`20else
X$`20`20`20`20`20say`20"**`20FAILED`20to`20compress`20MAIL`20file`20**"
X$`20`20`20endif
X$`20endif
X$`20if`20Retry`20`20then`20`20goto`20`20COMPRESS_MAIL
X$
X$`20purge`20/log`20SYS_2:`5BNEWSMGR.MAIL`5DMAIL.OLD`09!`20***`20SITE-SPECIFIC
V`20name`20***
X$
X$`20Compress_Mail`20=`200`09`09!`20Done`20!
X$`20on`20warning`20`20then`20`20goto`20`20ABORT
X$`20RETURN
X$
X$FAILED_COMPRESS:
X$`20on`20warning`20`20then`20`20goto`20`20ABORT
X$`20mail`20NL:`20usenet`20-
X`09/subject="%NEWSSKIM`20Alarm:`20COMPRESS_MAIL`20FAILED`20(''f$time()')"
X$
X$`20RETURN
X$
X$!----------------------------------------------------------------------------
V--
X$!`20`20Issue`20a`20report`20which`20advises`20which`20newsgroups`20are`20bein
Vg`20sent`20to`20the
X$!`20`20newsgroup`20JUNK.
X$
X$DO_REPORT_JUNK:
X$
X$`20set`20noon
X$`20search`20/nohead`20NEWS_DEVICE:`5BJUNK`5D*.ITM`20"Newsgroups:"`20-
X`09`20/out=NEWS_MANAGER:JUNK_SEARCH.TMP
X$`20sort`20/noduplicates`20NEWS_MANAGER:JUNK_SEARCH.TMP`20NEWS_MANAGER:JUNK_SE
VARCH.TMP
X$`20mail`20NEWS_MANAGER:JUNK_SEARCH.TMP`20usenet`20-
X`09/subject="%NEWSSKIM`20Information:`20JUNK`20item`20search"
X$`20delete`20/nolog`20NEWS_MANAGER:JUNK_SEARCH.TMP;*
X$`20set`20on
X$`20say`20"%Status`20report`20for`20newsgroup`20JUNK`20mailed`20to`20USENET
V`20at`20''f$time()'"
X$`20Report_Junk`20=`200`09`09!`20`20All`20done.
X$
X$`20RETURN
X$
X$!----------------------------------------------------------------------------
V--
X$!`20`20Re-Submit`20this`20job`20at`20the`20appropriate`20time.`20`20Allow`20a
V`20few`20minutes`20after`20the
X$!`20`20hour`20to`20ensure`20that`20any`20clock`20discrepencies`20in`20the`20c
Vluster`20are`20irrelevant.
X$
X$RESUBMIT_SELF:
X$
X$`20Hour`20=`20f$extract`20(12,2,f$time())`09`09!`20`20Use`20current`20time.
X$`20Cnt`20`20=`200
X$
X$`20if`20.not.`20Every_Hour`20`20then`20`20goto`20`20GET_NEXT
X$`20if`20Hour`20.eqs.`20Hour_Start
X$`20then
X$`20`20`20if`20Hour`20.eqs.`20"23"
X$`20`20`20then
X$`20`20`20`20`20When`20=`20"Tomorrow+00:05"
X$`20`20`20else
X$`20`20`20`20`20When`20=`20f$string`20(f$integer`20(Hour)`20+`201)`20+`20":05"
V
X$`20`20`20endif
X$`20else
X$`20`20`20When`20=`20Hour`20+`20"+:05"
X$`20endif
X$`20goto`20`20SUBMIT_IT
X$
X$GET_NEXT:
X$`20When`20=`20f$element`20(Cnt,",",Run_Times)
X$`20if`20When`20.nes.`20","`20`20then`20`20goto`20`20COMPARE_HOUR
X$`20When`20=`20f$element`20(0,",",Run_Times)`09`09!`20`20Use`20first`20run`20f
Vor`20tomorrow.
X$`20goto`20`20SCHEDULER
X$
X$COMPARE_HOUR:
X$`20Cnt`20=`20Cnt`20+`201
X$`20if`20When`20.les.`20Hour`20`20then`20`20goto`20`20GET_NEXT`09!`20`20Zip
V`20along`20until`20ok.
X$
X$SCHEDULER:
X$`20if`20When`20.gts.`20Hour
X$`20then
X$`20`20`20When`20=`20When`20+`20":05"
X$`20else
X$`20`20`20When`20=`20"Tomorrow+"`20+`20When`20+`20":05"
X$`20endif
X$
X$SUBMIT_IT:
X$`20if`20Resubmit`20.eq.`203`20`20then`20`20When`20=`20"YESTERDAY"`09!`20Ho-ho
V`20!!`20==>`20Immediately`20!!
X$`20say`20"%Re-submitting`20NEWSSKIM`20at`20''f$time()'"
X$`20submit`20NEWS_ROOT:NEWSSKIM.COM`20-
X`09/noprint`20-
X`09/notify`20-
X`09/keep`20-
X`09/restart`20-
X`09/queue`20=`20'Batch_Q'`20-
X`09'Q_Chars'`20-
X`09/cputime`20=`2008:00:00`20-
X`09/log`20=`20NEWS_ROOT:NEWSSKIM.LOG`20-
X`09/name`20=`20"News_Skim"`20-
X`09'Holder'`20-
X`09/after`20=`20"''When'"
X$
X$`20set`20noon
X$`20purge`20/nolog`20/modified`20/before=YESTERDAY`20NEWS_ROOT:NEWSSKIM.LOG
X$`20purge`20/nolog`20/keep=48`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20`20
V`20`20`20`20NEWS_ROOT:NEWSSKIM.LOG
X$`20set`20on
X$
X$`20RETURN
X$
X$!----------------------------------------------------------------------------
V--
X$!`20`20Special`20run`20-`20use`20parameters:`20one`20complete`20NEWS`20comman
Vd`20per`20parameter.
X$
X$DO_SPECIAL:
X$
X$`20say`20"%SPECIAL`20RUN."
X$`20gosub`20`20Check_Disk_Space`09`09`09`09!`20Ensure`20there`20is`20room.
X$`20if`20Disk_Space_Problem`20`20then`20`20goto`20`20EXIT_DOOR
X$
X$`20close`20/nolog`20cmd_file
X$`20open`20`20/write`20cmd_file`20`20SYS$SCRATCH:TEMP_INPUT_'Pid'.DAT
X$`20write`20`20cmd_file`20`20"''p2'"`09`09`09`09!`20P2`20must`20be`20there.
X$`20if`20p3`20.nes.`20""`20`20then`20`20write`20`20cmd_file`20`20"''p3'"
X$`20if`20p4`20.nes.`20""`20`20then`20`20write`20`20cmd_file`20`20"''p4'"
X$`20if`20p5`20.nes.`20""`20`20then`20`20write`20`20cmd_file`20`20"''p5'"
X$`20if`20p6`20.nes.`20""`20`20then`20`20write`20`20cmd_file`20`20"''p6'"
X$`20if`20p7`20.nes.`20""`20`20then`20`20write`20`20cmd_file`20`20"''p7'"
X$`20if`20p8`20.nes.`20""`20`20then`20`20write`20`20cmd_file`20`20"''p8'"
X$`20write`20`20cmd_file`20`20"exit"
X$`20close`20/nolog`20cmd_file
X$
X$`20gosub`20`20Check_Stop
X$
X$`20define`20/user_mode`20`20SYS$INPUT`20`20SYS$SCRATCH:TEMP_INPUT_'Pid'.DAT
X$`20news`20/noscreen
X$`20delete`20SYS$SCRATCH:TEMP_INPUT_'Pid'.DAT;*
X$
X$`20goto`20`20EXIT_DOOR
X$`20EXIT`09`09!`20Safety`20net.
X$
X$!----------------------------------------------------------------------------
V--
X$!`20`20Come`20here`20to`20die`20unnaturally.`20`20Notify`20USENET`20account
V`20(*NOT*`20NEWSMGR!!).
X$
X$ABORT:
X$
X$`20set`20noon
X$`20if`20Fail_msg1`20.nes.`20""
X$`20then
X$`20`20`20say`20Fail_msg1
X$`20`20`20Fail_msg1`20=`20crlf`20+`20Fail_msg1
X$`20endif
X$`20if`20Fail_msg2`20.nes.`20""
X$`20then
X$`20`20`20say`20Fail_msg2
X$`20`20`20Fail_msg2`20=`20crlf`20+`20Fail_msg2
X$`20endif
X$
X$`20say`20"######`20`20''Process_Name'`20terminated`20ON`20ABORT`20`20######"
X$`20subject`20=`20"%NEWS`20Alarm:`20JOB`20''Process_Name'`20ABORTED`20(''f$tim
Ve()')"`20+`20-
X`09`20`20`20`20Fail_msg1`20+`20Fail_msg2
X$`20mail`20NL:`20usenet`20/subject="''subject'"
X$
X$`20goto`20`20EXIT_DOOR
X$`20EXIT`09`09!`20Safety`20net.
X$
X$!============================================================================
V==
X$!`20`20The`20EXIT`20DOOR`20-`20always`20end`20through`20here.
X$
X$EXIT_DOOR:
X$
X$`20if`20Postmaster`09`09!`20Give`20up`20the`20lock
X$`20then
X$`20`20`20close`20/nolog`20Post_Lock
X$`20`20`20set`20noon
X$`20`20`20if`20f$search`20(Post_Lock_File)`20.nes.`20""`20`20then`20-
X`09`20`20delete`20/nolog`20'Post_Lock_File';*`09`09!`20Clean`20up.
X$`20`20`20set`20on
X$`20endif
X$
X$`20if`20NNTPmaster`09`09!`20Give`20up`20the`20lock
X$`20then
X$`20`20`20close`20/nolog`20NNTP_Lock
X$`20`20`20set`20noon
X$`20`20`20if`20f$search`20(NNTP_Lock_File)`20.nes.`20""`20`20then`20-
X`09`20`20delete`20/nolog`20'NNTP_Lock_File';*`09`09!`20Clean`20up.
X$`20`20`20set`20on
X$`20endif
X$
X$`20if`20verify`20then`20$`20EXIT`20f$verify(1)`20+`201
X$`20EXIT`201
$ call unpack NEWSSKIM_ALT.COM;1 558989242 ""
$!
$ create 'f'
X!`20FORCEX.CLD
+-+-+-+-+-+-+-+-  END  OF PART 5 +-+-+-+-+-+-+-+-