Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!ll-xn!mit-eddie!apollo!rees From: rees@apollo.uucp (Jim Rees) Newsgroups: news.admin,news.sysadmin,news.software.b Subject: Re: Expiration time for newsgroups Message-ID: <337b4fad.982f@apollo.uucp> Date: Thu, 5-Mar-87 09:08:00 EST Article-I.D.: apollo.337b4fad.982f Posted: Thu Mar 5 09:08:00 1987 Date-Received: Sat, 7-Mar-87 05:07:24 EST References: <94@asi.UUCP> Organization: Apollo Computer, Chelmsford, Mass. Lines: 52 Xref: mnetor news.admin:196 news.sysadmin:58 news.software.b:343 Has anyone considered adding a field to the active file which specifies the default expiration time for that news group? Some people advocate running expire multiple times with different expiration times for each run, but that's pretty inefficient. I've hacked up our expire to read expiration times from a file. Here are the relevant routines: struct { char *pat; long incr; } nga[100]; readexpdays() { char buf[BUFLEN], ngbuf[BUFLEN]; FILE *f; int i, n; long incr; sprintf(buf, "%s/%s", LIB, "expdays"); f = xfopen(buf, "r"); i = 0; while (fgets(buf, sizeof buf, f) != NULL) { n = sscanf(buf, "%s %d", ngbuf, &incr); if (n < 1) continue; if (n == 1) nga[i].incr = expincr; else nga[i].incr = incr * DAYS; nga[i].pat = malloc(strlen(ngbuf) + 1); strcpy(nga[i].pat, ngbuf); i++; } nga[i].pat = NULL; fclose(f); } getincr(group) char *group; { int i; for (i = 0; nga[i].pat != NULL; i++) if (ngmatch(group, nga[i].pat)) { if (verbose > 2) printf("pattern %s incr %d days\n", nga[i].pat, nga[i].incr / DAYS); return (nga[i].incr); } return -1; }