🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #13605

Re: KILLing while not there in trn

#13605
From: Peter Kappesser
Date: Fri, 09 Dec 1994 09:54
118 lines
5855 bytes
Recently in news.software.readers,
	dlb2a@sunipc-9.unixlab.Virginia.EDU (David Lee Brown) wrote:
>
>I'm going to be going home for winter break.  What I'd like to do, in
>trn, is to have it automatically perform KILL commands, while I'm not
>here, at an interval so that I don't have to sift though lots of job 
>bulletin newgroups.  Unfortunately, I'm not a UNIX genius.  I assume
>that if this is possible, UNIX will take care of it for me.

This is covered in the FAQ, which I'm finishing revising before its
scheduled posting on Sunday, but here's the relevant excerpt. If you're
unfamiliar with how to install a shell script or set up a cron job (which
executes a program at a scheduled time), you may need to enlist the aid of a
Unix helper locally.

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

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.

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

Subject: CSKF: I hate the way trn saves its killfiles! How can I change it?
Contributors: Peter J. Kappesser <pjkappes@mailbox.syr.edu>,
        Leanne Phillips <felan@netcom.com> [Adapted from the rn KILL file FAQ]

By default trn saves killfiles for each newsgroup in a file named KILL
in a subdirectory built from the name of the newsgroup, e.g.
$HOME/News/news/software/readers/KILL. It is possible to change the
locations of your KILL files, by setting the environment variables
KILLGLOBAL and KILLLOCAL.  The most popular method is to put all the
files in one directory using the group name as the file name:

	KILLLOCAL="%p/Kill/%C"
        KILLGLOBAL="%p/Kill/global"

Where %p is the news directory ($HOME/News by default) and %C is the
name of the group. The global kill file is in the same directory, with
the name "global".

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

Subject: CVNF: How can I use various .newsrc with trn?
Contributor: Steven King <king@wildebeest.cig.mot.com>

Make a separate directory for each .newsrc you want, then set the DOTDIR
environment variable to point to the proper directory.  See the trn man
page for more information.

Alternately, you can make separate .newsrc files in your home directory
(say, .newsrc-1, .newsrc-2, etc.) and softlink the appropriate one to
.newsrc.  (This may cause a problem with other dot files, like .rnsoft
and .rnlast.  I think I'd recommend the DOTDIR method, actually.)  For
information about making softlinks, see the man page for "ln".  The
basic syntax is "ln -s .newsrc-1 .newsrc".

------------------------------
Technical Details
Message-ID: <3c99fs$8se@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!bga.com!news.sprintlink.net!hookup!news.kei.com!travelers.mail.cornell.edu!newstand.syr.edu!hydra.syr.edu!pjkappes
References: <D0Gvpr.Ew0@murdoch.acc.virginia.edu>

Show Full Headers
Complete Article Headers
Message-ID: <3c99fs$8se@newstand.syr.edu>
Subject: Re: KILLing while not there in trn
Date: Fri, 09 Dec 1994 09:54:04 +0000
From: pjkappes@hydra.syr.edu (Peter Kappesser)
References: <D0Gvpr.Ew0@murdoch.acc.virginia.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!bga.com!news.sprintlink.net!hookup!news.kei.com!travelers.mail.cornell.edu!newstand.syr.edu!hydra.syr.edu!pjkappes
Newsgroups: news.software.readers
Organization: Not Quite Syracuse University, Syracuse, NY
Lines: 119
Reply-To: pjkappes@mailbox.syr.edu
NNTP-Posting-Host: hydra.syr.edu
Cc: dlb2a@sunipc-9.unixlab.Virginia.EDU