🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #13977

Re: Timed background saving of News?

#13977
From: Peter Kappesser
Date: Thu, 22 Dec 1994 21:02
83 lines
4347 bytes
Recently in news.software.readers, 
	don@nero.rice.edu (Don Schroeder x3582) wrote:
>Anyone know if a program exists or if it's possible to write
>one to read and save articles of a newsgroup?  Our news server
>deletes postings after only a couple days due to disk space
>constraints, and I've been losing articles over the weekend
>(and Newsclip won't run on our system)..

If trn is available, you can use the script below (from the FAQ), run by a
cron job. One note that's not obvious, you need to have separate killfiles
for each newsgroup in the .newsrc, and not just use a global killfile; trn
evidently looks at the THRU line in the killfile to determine where to
start, otherwise it'll always start from the first article available,
perhaps saving again an article that had been saved in a previous session.

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

Subject: ATKS: I want to set up a simple news archive. How can I run TRN
        non-interactively (e.g. as a cron job)?
Contributors: Michael Owings <mikey@waste.com>,
        Wayne Davison <davison@borland.com>,
        Peter J. Kappesser <pjkappes@mailbox.syr.edu>

Run the "trnkill" script included below from cron and it will enter
every subscribed group you have just long enough to run the kill file,
and then exit.

---8<------8<------8<------8<---cut here--->8------>8------>8------>8---
#!/bin/sh
# trnkill - shell script to apply trn KILL files in the background
# 14 Mar 89  created for rn by Jim Olsen <olsen@XN.LL.MIT.EDU>
# 10 Sep 93  modified for trn 3 (or 2) by Wayne Davison <davison@borland.com>
# Options: -d	debug mode -- you see all gory action as it happens.

# Visit all newsgroups (if trn asks about anything else, just say no)
export TRNINIT TRNMACRO RNMACRO
TRNINIT='-q -s -T -t -x +X'
TRNMACRO=/tmp/trnkill$$

# support for trn 2.x
RNMACRO=$TRNMACRO

# support for versions older than 3.6 on some systems
TERM=dumb ; export TERM

trap 'rm -f $TRNMACRO; exit' 1 2 3 15
cat >$TRNMACRO <<'EOF'
z  %(%m=[nf]?.q^J:n)^(z^)
^m ^(z^)
^j ^(z^)
EOF
if test X$1 = X-d; then
	echo "z" | trn
else
	echo "z" | trn >/dev/null 2>&1
fi
rm -f $TRNMACRO
exit 0
---8<------8<------8<------8<---cut here--->8------>8------>8------>8---

If trn crashes when you try to run it as a cron job, it's a problem with
no terminal being set in the cron-run environment, which is confusing
trn.  Trn 3.6 fixes this problem by assuming that if you don't have TERM
set in your environment that your terminal is "dumb". The commands
"TERM=dumb" and "export TERM" in the trnkill script gets this to work
with older trns.

One application of this is to run trnkill in the background when you
login, so it will "pre-kill" all your newsgroups and you won't have to
wait as long for trn to process the killfiles when you're actually
reading news, especially in high-volume, high-noise newsgroups. (Read
your mail first, since you won't be able to run trn until trnkill
finishes; or set up a cron job to run shortly before you usually login.)

You can set up a simple news archive by setting the envariables DOTDIR,
KILLGLOBAL and KILLLOCAL to point to a directory with a special-purpose
.newsrc and killfiles. The killfiles contain commands to select and save
the desired articles. (See Subject: CVNF and Subject: CSKF in Part 1 of
this FAQ.) The maintainer of this FAQ uses this method to archive all
articles that mention trn in news.software.readers.

--
pjkappes@mailbox.syr.edu (Peter Kappesser)
Technical Details
Message-ID: <3dcph2$sqn@newstand.syr.edu>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.readers.mbox.zip!nntp.gmd.de!newsserver.jvnc.net!howland.reston.ans.net!vixen.cso.uiuc.edu!uwm.edu!caen!news.tc.cornell.edu!travelers.mail.cornell.edu!newstand.syr.edu!forbin.syr.edu!pjkappes
References: <3d7nsl$1kr@larry.rice.edu>

Show Full Headers
Complete Article Headers
Message-ID: <3dcph2$sqn@newstand.syr.edu>
Subject: Re: Timed background saving of News?
Date: Thu, 22 Dec 1994 21:02:26 +0000
From: pjkappes@forbin.syr.edu (Peter Kappesser)
References: <3d7nsl$1kr@larry.rice.edu>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!archive!mbox2nntp-news.software.readers.mbox.zip!nntp.gmd.de!newsserver.jvnc.net!howland.reston.ans.net!vixen.cso.uiuc.edu!uwm.edu!caen!news.tc.cornell.edu!travelers.mail.cornell.edu!newstand.syr.edu!forbin.syr.edu!pjkappes
Newsgroups: news.software.readers
Organization: Not Quite Syracuse University, Syracuse, NY
Lines: 83
Distribution: world
Reply-To: pjkappes@mailbox.syr.edu
NNTP-Posting-Host: forbin.syr.edu