🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: news.software.nntp
Article #3780

Re: Q. How to zap articles cross-posted to groups I don't want to receive?

#3780
From: Duncan Gibson
Date: Fri, 18 Aug 1995 00:00
96 lines
4045 bytes
Thanks for the info, but unfortunately we are running cnews, not inn.

Anyway, [and sort of following on from the reply to Peter da Silva]
I hacked together a utility for extracting the Xrefs: from the first
line of an article. I don't know whether this is guaranteed to work
everywhere (there may still be bugs in it, it might be too simplistic,
other news systems might not have XRefs: as the first line, whatever).

When used in combination with 'find' on the hierarchies I don't want,
I was able to recover 200Mb of disk space, and that's with a 1 to 4
day expiry on most groups! 200Mb of disk space and network time in and
out for hierarchies that my feed doesn't even send me in the first place.
It's made quite a difference to the backlog for our sub-feed, because now
we can actually get more, smaller articles through before their disk
fills than was the case with all of these binaries.

Use the following at your own risk!

Cheers
Duncan

This is my article, not my employer's, with my opinions and my disclaimer!
--
Duncan Gibson, ESTEC/YCV, Postbus 299, 2200AG Noordwijk, The Netherlands
Tel: +31 1719 84013   Fax: +31 1719 12142  Email: duncan@yc.estec.esa.nl

    #!/bin/sh
    for article in `find /usr/spool/news/alt/binaries/pictures -type -f -print`
    do
        art-xrefs $article > /tmp/xrefs
        for xref in `cat /tmp/xrefs`
        do
            ls -l /usr/spool/news/$xref
            #rm -f /usr/spool/news/$xref
        done
    done


    /*
     * art-xrefs.c
     */
    #include <stdio.h>

    int main(
        int argc,
        char *argv[]
    )
    {
        FILE *pFile;
        This is an error to make you change InsertHostName below!
        char *szLeadingText = "Xref: InsertHostNameHere "; 
        char szArticlePath[100];
        int inLeadingText;
        int error;
        int nchars;
        int ch;
        int i;

        while (*++argv != NULL) {
            pFile = fopen(*argv, "r");
            if (pFile != NULL) {
                nchars = 0;
                error = 0;
                for (i = 0; i < strlen(szLeadingText); i++) {
                    ch = fgetc(pFile);
                    if (ch != szLeadingText[i]) {
                        error = 1;
                        break;
                    }
                }
                if (error == 0) {
                    while ((ch = fgetc(pFile)) != EOF) {
                        if (ch == ' ' || ch == '\n') {
                            szArticlePath[nchars] = '\0';
                            printf("%s\n", szArticlePath);
                            nchars = 0;
                            if (ch == '\n') {
                                break;
                            }
                        } else
                        if (ch == '.' || ch == ':') {
                            szArticlePath[nchars] = '/';
                            nchars++;
                        } else {
                            szArticlePath[nchars] = ch;
                            nchars++;
                        }
                    }
                }
                (void)fclose(pFile);
            }
        }
        return(0);
    }

Technical Details
Message-ID: <DDIJ61.2AF@yc.estec.esa.nl>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.admin.misc.mbox.zip!not-for-mail
References: <DCxoq5.5w1@yc.estec.esa.nl> <950808.091527.1y4.rnr.w164w@alpha3.ersys.edmonton.ab.ca> <DD1vAq.A93@yc.estec.esa.nl> <40paeq$r7q@rodan.uu.net>

Show Full Headers
Complete Article Headers
Message-ID: <DDIJ61.2AF@yc.estec.esa.nl>
Subject: Re: Q. How to zap articles cross-posted to groups I don't want to receive?
Date: Fri, 18 Aug 1995 00:00:00 +0000
From: duncan@yc.estec.esa.nl (Duncan Gibson)
References: <DCxoq5.5w1@yc.estec.esa.nl> <950808.091527.1y4.rnr.w164w@alpha3.ersys.edmonton.ab.ca> <DD1vAq.A93@yc.estec.esa.nl> <40paeq$r7q@rodan.uu.net>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!illumos!news.pugleaf.net!.TX!archive.pugleaf.net!archive.newsdeef.eu!mbox2nntp-news.admin.misc.mbox.zip!not-for-mail
X-Deja-AN: 108414175
Organization: ESA/ESTEC/YC, Noordwijk, The Netherlands
Newsgroups: news.software.b,news.software.nntp,news.admin.misc