Thread View: news.software.nntp
4 messages
4 total messages
Started by Liam Friel
Wed, 10 Jan 2001 11:16
FAQ? Different group names on incoming feed and locally (INN)
Author: Liam Friel
Date: Wed, 10 Jan 2001 11:16
Date: Wed, 10 Jan 2001 11:16
27 lines
1830 bytes
1830 bytes
Hi, I have a problem which is probably a FAQ for INN but I can't find the answer. Even more annoying, I know I did something similar about two years ago but I can't for the life of me remember how. I want to move a bunch of local groups from one INN server to a replacement server, while: 1. Preserving all existing posting history 2. Renaming the groups and re-organising the group structure. Moving them to the other server while keeping the same group structure/name is easy. But I can't remember how to simultaneously pull off the renaming of the groups ... The current server is INN 2.2 on RedHat, the new server will be INN (?) on Solaris. Thanks, Liam
Re: FAQ? Different group names on incoming feed and locally (INN)
Author: Russ Allbery
Date: Wed, 10 Jan 2001 11:28
Date: Wed, 10 Jan 2001 11:28
97 lines
4390 bytes
4390 bytes
Liam Friel <liam.friel@s3group.com> writes:
> I have a problem which is probably a FAQ for INN but I can't find the
> answer. Even more annoying, I know I did something similar about two
> years ago but I can't for the life of me remember how.
> I want to move a bunch of local groups from one INN server to a
> replacement server, while:
> 1. Preserving all existing posting history
> 2. Renaming the groups and re-organising the group structure.
> Moving them to the other server while keeping the same group
> structure/name is easy. But I can't remember how to simultaneously pull
> off the renaming of the groups ...
> The current server is INN 2.2 on RedHat, the new server will be INN (?)
> on Solaris.
Try a modification of the following script. As is, it only fixes Xref
headers (it was originally intended to prep a tree of old articles from a
pre-1.5 server that didn't all have Xref headers for transfer to a 2.3
server), but you could tweak it to change the Newsgroups and Xref headers
to change the names of the groups to which the articles will be posted.
Then use find to generate a list of files from the tree created by this
script and pass that to innxmit.
#!/usr/bin/perl
$ID = q$Id: fixref,v 1.1 2001/01/10 11:27:37 eagle Exp $;
#
# fixref -- Fix the Xref headers in a tree of news articles.
#
# Written by Russ Allbery <rra@stanford.edu>
# Copyright 2000 Board of Trustees, Leland Stanford Jr. University
#
# Copy a tree of traditional spool news articles, fixing the Xref headers as
# we go. Add Xref headers if missing (based on the path to the article),
# and if an Xref header is present, trim out hierarchies other than those
# given on the command line.
#
# Usage: fixref -a <hierarchy-pattern> <from> <to> <hierarchy>
use strict;
use vars qw($ALLOW $COUNT %DONE $FROM $ID $TO);
use File::Find qw(find);
use File::Path qw(mkpath);
use Getopt::Long qw(GetOptions);
sub copy {
return unless -f $_;
return unless /^\d+$/;
my $path = $File::Find::dir;
$path =~ s%^\Q$FROM\E/*%%;
open (SRC, "< $_") or die "Can't open $File::Find::name: $!\n";
mkpath ("$TO/$path", 0, 0755) unless $DONE{$path}++;
open (DST, "> $TO/$path/$_") or die "Can't open $TO/$path/$_: $!\n";
my $header = 1;
my $havexref = 0;
while ($header) {
my $line = <SRC>;
if ($line =~ /^Xref: /) {
if ($ALLOW) {
my ($xref, $server, @groups) = split (' ', $line);
@groups = grep { /$ALLOW/ } @groups;
$line = join (' ', $xref, $server, @groups) . "\n";
}
$havexref = 1;
} elsif ($line =~ /^[\r\n]*$/) {
unless ($havexref) {
my $group = $path;
$group =~ tr%/%.%;
$group .= ":$_";
print DST "Xref: fixref $group\n";
}
$header = 0;
}
print DST $line;
}
local $_;
print DST while <SRC>;
close SRC;
close DST or die "Can't flush $TO/$path/$_: $!\n";
print "$COUNT articles processed\n" if ((++$COUNT % 100) == 0);
}
GetOptions ('allow|a=s' => \$ALLOW) or exit 1;
my $hierarchy;
($FROM, $TO, $hierarchy) = @ARGV;
die "Usage: fixref [-a <allow>] <from> <to> <hierarchy>\n"
unless $hierarchy;
find (\©, "$FROM/$hierarchy");
--
Russ Allbery (rra@stanford.edu) <http://www.eyrie.org/~eagle/>
Re: FAQ? Different group names on incoming feed and locally (INN)
Author: Liam Friel
Date: Wed, 10 Jan 2001 15:50
Date: Wed, 10 Jan 2001 15:50
19 lines
1613 bytes
1613 bytes
Russ Allbery <rra@stanford.edu> wrote in message news:ylwvc3abo9.fsf@windlord.stanford.edu... > > Try a modification of the following script. As is, it only fixes Xref <snip> OK, thanks, I certainly will do so, although I am quite sure then when I imported the posting history into INN I didn't have to do this sort of thing. Would "suck" do what I want, i.e. does it support posting of messages sucked from one group into another one? Is there a read-made version of suck available for Solaris? Liam
Re: FAQ? Different group names on incoming feed and locally (INN)
Author: Russ Allbery
Date: Wed, 10 Jan 2001 23:21
Date: Wed, 10 Jan 2001 23:21
30 lines
2317 bytes
2317 bytes
Liam Friel <liam.friel@s3group.com> writes: > OK, thanks, I certainly will do so, although I am quite sure then when I > imported the posting history into INN I didn't have to do this sort of > thing. There are all sorts of easy ways to do this if you're not changing what groups the articles are posted to, but if you're changing the groups, I think you'll find this is a lot easier. It used to be easier with INN to just run makehistory on a collection of random articles to generate a history database from them, but I really don't recommend doing things that way any more. It's much more work for the server. It's better to use find to generate a list of articles to pass to innxmit (and start the server with artcutoff set to 0 so that it will accept old articles). That makes sure that everything gets generated and put in the right place and handles things like conversion to wire format if the configuration of the new server is different than that of the old. > Would "suck" do what I want, i.e. does it support posting of messages > sucked from one group into another one? I don't know if suck can change which newsgroups articles are posted to; normally, it doesn't. I don't use suck, however, so I don't know all of its capabilities. -- Russ Allbery (rra@stanford.edu) <http://www.eyrie.org/~eagle/>
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