From: ciaran@aldhfn.akron.oh.us (Skip Watson)
Newsgroups: alt.sys.amiga.uucp
Subject: Re: Cnews questions
Distribution: world
Reply-To: ciaran@aldhfn.akron.oh.us
X-NewsSoftware: GRn 1.16f (10.17.92) by Mike Schwartz & Michael B. Smith
Date: 16 Dec 92 01:34:42 EST
Organization: Auldhaefen Associates

In article <bobl.a6s2@bobsbox.rent.com> bobl@bobsbox.rent.com (Bob Lindabury - SysAdmin) writes:
[...]
> Also, I'm probably being a dweeb here but my unbatch script seems to
> want to do a complete processing of the entire Newsarts:in.coming
> directory instead of on a file by file basis...meaning it will first
> acomp every .z file, then it will unbatch every file in the directory
> and then it will delete all the files.  Of course this amounts to TONS
> of wasted space when processing news.  Say I get 20 megs of compressed
> news in one pass..the files all get copied to newsarts:in.coming by
> rnews and then later processed by unbatch.  This can result in around
> 25-30 megs of uncompressed batched news which then has to be unbatched
> taking up an additional 30-40 megs making a single groups of 20
> compressed and batched news files requiring a whopping total of 60 megs
> of HD space just to process.

	I came up with that one because the scripts that came with cnews
didn't work with 1.3 (no matter how I changed them). That one at least
allowed me to use cnews. I never said it was a good script, only that it
worked :-).
	When I finally upgraded to 2.04, I didn't change anything because I
had forgotten about it. It was working so I wasn't about to fix it :-).

> Does anyone have the script line that will tell unbatch to acomp,
> unbatch and then delete each file one at a time instead of the current
> list LFORMAT >filename method?  It would save me untold grief.

	Well, I went back and looked at the original scripts and modified
the one a bit. They are now working. They've been unbatching news
flawlessly (knock wood) for the past 6 hours. I guess they're safe :-). 

------------ newsbin:relay/unbatch modified from Frank's original -------------
;
;	This script unbatches news found in NewsArts:In.Coming/
;
LAB Check_Again
If EXISTS T:Cnews.lock
	Wait 65
	SkipBack Check_Again
EndIf
Echo >T:Cnews.lock "Relaynews"

Path Add NewsBin:Misc NewsBin:Relay

; setup so we can cd back to where we started from

echo >t:dir noline "cd "
cd >>t:dir

CD NewsArts:In.Coming

; backup up the batches just in case :-)

delete >nil: bkup/#?.Z
copy >nil: #?.Z bkup

SetEnv Exec T:batch[$$].Exec
SetEnv News T:batch[$$].News
SetEnv Temp T:batch[$$].Temp
SetEnv Del T:batch[$$].Del
Delete >NIL: $News $Del

Echo >T:batch[$$].Del NOLINE ""
Echo >$News NOLINE ""
Echo >$Del NOLINE ""

; handle locally posted articles

List TO $Temp 4#? LFORMAT "UnBatch.e2 %s $News"

FailAt 21

Sort $Temp TO $Exec
Execute $Exec

; setup and unbatch compressed batches

List TO $Temp #?.z LFORMAT "UnBatch.e2 %s $News"

FailAt 21

Sort $Temp TO $Exec
Execute $Exec

; clean up

Delete QUIET $News ENV:News $Temp ENV:Temp
Delete QUIET $Exec ENV:Exec ENV:Del $del
Delete QUIET T:Cnews.lock t:batch#?
x t:dir
delete QUIET t:dir

---------------------- newsbin:relay/unbatch.e2 ------------------------------
.key FROM/A,TO/A
.bra [
.ket ]
;
;
Failat 1;	Because of what the return code from ACOMP looks like...
;Echo NOLINE "Uncompressing [FROM] ..."
compress -d >[TO] <[FROM]
;
Failat 32;	Because of what the return code from RELAYNEWS looks like...
;Echo "  Processing news batch ..."
RelayNews <[TO] -r
;
Delete [FROM]

-------------------------------- cut here -------------------------------------

	These should, hopefully, do the trick.

Skip
--
Internet: ciaran@aldhfn.akron.oh.us    UUCP: ciaran@aldhfn.UUCP
Auldhaefen Associates                  Email: auldhaefen@aldhfn.akron.oh.us