Thread View: news.software.readers
2 messages
2 total messages
Started by Don Schroeder x3582
Tue, 20 Dec 1994 23:03
Timed background saving of News?
Author: Don Schroeder x3582
Date: Tue, 20 Dec 1994 23:03
Date: Tue, 20 Dec 1994 23:03
11 lines
1037 bytes
1037 bytes
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)..
Many thanks,
don@rice.edu
Re: Timed background saving of News?
Author: Peter Kappesser
Date: Thu, 22 Dec 1994 21:02
Date: Thu, 22 Dec 1994 21:02
83 lines
4347 bytes
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)
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads