🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.readers
Article #3916

Re: TIN: save unread articles to a file

#3916
From: Derek Bell
Date: Mon, 19 Apr 1993 10:53
102 lines
3392 bytes
Devin the Elephant (devin@telerama.pgh.pa.us) wrote:
: One of the users we support wrote to me with this question:

: "I'd like to know how to, for a given newsgroup, specify that all the
: new posts are to be gathered up into a single file (straight ascii
: ok), and then downloaded.  Thanks..."

: It's not obvious to me from the tin man page how to do this.  Does
: anyone have a suggestion?

What you can do is use the -S option to save out all the messages.  This
creates a file for each post in a directory like the group name ie posts
for alt.sources would be in alt/sources in your News directory.  You can then
run the script below which copies any posts into the one file called
[groupname]_yymmdd - just the groupname with the date appended.

The script is actually two files called process and process.loop which is
called from within process.  OK its a bit messy but I only wrote it yesterday
and its my first go at writing a script longer than about 4 lines.  It may
be bugged - one problem is if messages run from about 995 to 1005 say,
1000-1005 are stored first as tin doesn't put a 0 before the 9.

file process

#!/bin/csh

set today = (`date '+%y%m%d'`)
setenv TODAY $today

#uncomment the following line if your tin directory is not in a standard
#place

#setenv TINDIR $HOME/.news

#change this line to alter where the files are put

setenv SAVEDIR $TINDIR/saved

#change this line if news items are stored somewhere else

setenv NEWSDIR $TINDIR/News

#create the save directory if it doesn't exist

if (! -e $SAVEDIR) then
	echo creating directory $SAVEDIR
	mkdir $SAVEDIR
else if (-f $SAVEDIR) then
	echo Error: $SAVEDIR exists and is not a directory
	exit (1)
endif

cd $NEWSDIR
set currdir=$cwd
foreach i (`/bin/ls .`)
	if (-d $currdir/$i) then
		echo changing into $i
		cd $i
		process.loop $i
		cd $currdir
	endif
end

file process.loop

#!/bin/csh

set thisfile = $SAVEDIR/$1_$TODAY
set currdir=$cwd
foreach i (`/bin/ls .`)
	if (! -d $currdir/$i) then
		if (! -e $thisfile) then
			echo creating $thisfile
			cp /dev/null $thisfile
		endif
		echo copying $i to $thisfile:t
		cat $i >> $thisfile
	else
		echo changing into $i
		cd $i
		process.loop $1.$i
		cd currdir
	endif
end



Hope these help

--
Derek.
=====================================================

INTERNET	dbell@mcs.dundee.ac.uk
JANET		dbell@uk.ac.dundee.mcs

"I've got this shocking pain right behind the eyes.
Have you considered amputation?"

       -- Vila and Avon  [Blakes7 - Redemption]

=====================================================
Technical Details
Message-ID: <1qu0bo$kh6@dux.dundee.ac.uk>
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!gmd.de!newsserver.jvnc.net!howland.reston.ans.net!agate!doc.ic.ac.uk!dundee.ac.uk!clyde!dbell
References: <1qsjpi$ik@telerama.pgh.pa.us>

Show Full Headers
Complete Article Headers
Message-ID: <1qu0bo$kh6@dux.dundee.ac.uk>
Subject: Re: TIN: save unread articles to a file
Date: Mon, 19 Apr 1993 10:53:44 +0000
From: dbell@clyde.mcs.dundee.ac.uk (Derek Bell)
References: <1qsjpi$ik@telerama.pgh.pa.us>
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!gmd.de!newsserver.jvnc.net!howland.reston.ans.net!agate!doc.ic.ac.uk!dundee.ac.uk!clyde!dbell
Newsgroups: news.software.readers
Organization: Maths & C.S. Dept., Dundee University, Scotland, UK
Lines: 102
NNTP-Posting-Host: clyde.mcs.dundee.ac.uk
X-Newsreader: TIN [version 1.1 PL9]