[news.software.b] How do I tell expire to never expire a single group under Cnews?.

greyham@hades.ausonics.oz.au (Greyham Stoney) (08/13/90)

I think I've managed to set up my explist file correctly; but there is one
thing that doesn't seem too clear from the manual page for expire:
How do I tell expire to never expire a single group under Cnews?. We have
one group that I never want anything expired from; I figured that by setting
the three expire date fields to something huge, it won't ever get around to
expiring articles - is this correct?.

At the moment my explist file looks like this:
--------------------------------------------------------------------------
# modified version, no archiving
#
# hold onto history lines 14 days, nobody gets >90 days
/expired/			x	14	-
/bounds/			x	0-1-90	-

# override later defaults for some groups of note
all.sources,all.sources.all	x	10	-
aus.all				x	10	-
comp.os.minix			x	10	-
comp.unix.i386			x	10	-

# don't ever expire local.permanent
local.permanent			x	10000-10000-10000	-

# big non-tech groups held long enough for a long weekend
sci,rec,talk,soc,misc,alt	u	4	-

# real noise gets thrown away fast
news.groups			x	2	-
junk				x	1	-

# default:  7 days don't archive
all				x	7	-
--------------------------------------------------------------------------
local.permanent is the group in question; will this work ok?.

							thanks,
								Greyham.
-- 
/*  Greyham Stoney:                            Australia: (02) 428 6476
 *  greyham@hades.ausonics.oz.au - Ausonics Pty Ltd, Lane Cove, Sydney, Oz.
 *		Neurone Server: Brain Cell not Responding.
 */

henry@zoo.toronto.edu (Henry Spencer) (08/14/90)

In article <1990Aug13.024146.1575@hades.ausonics.oz.au> greyham@hades.ausonics.oz.au (Greyham Stoney) writes:
>I think I've managed to set up my explist file correctly; but there is one
>thing that doesn't seem too clear from the manual page for expire:
>How do I tell expire to never expire a single group under Cnews?...

At the moment, giving it a big number is all you can do.  Provision for
some more explicit way of saying "never" is on the to-be-done list.

When choosing big numbers, beware of integer overflow; 32 bits is none
too large for this application.  "10000" (slightly under 30 years) is safe
for the next decade or two.
-- 
It is not possible to both understand  | Henry Spencer at U of Toronto Zoology
and appreciate Intel CPUs. -D.Wolfskill|  henry@zoo.toronto.edu   utzoo!henry

ericm@skate.awdpa.ibm.com (Eric Murray) (04/12/18)

In article <1990Aug13.024146.1575@hades.ausonics.oz.au> greyham@hades.ausonics.oz.au (Greyham Stoney) writes:
>I think I've managed to set up my explist file correctly; but there is one
>thing that doesn't seem too clear from the manual page for expire:
>How do I tell expire to never expire a single group under Cnews?.

You hack it to understand 'never' in the explist file.

% diff -c expire.c expire.c.old

*** expire.c	Thu Jun  7 11:38:56 1990
--- expire.c.old	Thu Jun  7 10:16:32 1990
***************
*** 123,132 ****
  void euclose();
  char *whereexpire();
  time_t back();
- 
- /* ericm hack */
- time_t backtime();
- 
  void checkdir();
  void fail();
  void control();
--- 123,128 ----
***************
*** 259,315 ****
  	char line[200];		/* long enough for any sane line */
  	register char *p;
  	void ctlline();
- 	char *buf;
- 	int	got_cont = 0;
  
- 	/* ericm hacks.... modified to accept lines ending in '\\n' (the \n is
- 	*	invisible of course) as a line continuation deal.
- 	*/
- 	buf = (char *)0;
  	while (fgets(line, sizeof(line), f) != NULL) {
  		p = &line[strlen(line) - 1];
  		if (*p != '\n')
  			fail("control line `%.30s...' too long", line);
- 
  		*p = '\0';
! 		if (line[0] == '#' || line[0] == '\0')
! 			continue;
! 
! 		if (*(p-1) == 0134 )
! 			got_cont = 1;
! 
! 		if (got_cont) {
! 			/* line continuation */
! 			char *tmp = buf;
! 
! 			if (*(p-1) != 0134 )
! 				got_cont = 0;
! 			else
! 				*(p-1) = '\0';	/* erase the '\' */
! 
! 			if ((buf = (char *)malloc(strlen(tmp) + strlen(line) + 1)) == NULL){
! 				fail("out of memory for control line", "");
! 			}
! 			strcpy(buf,tmp);
! 			strcat(buf,line);
! 		}
! 		if (!got_cont) {
! 			if (!buf) {
! 				if (line[0] != '#' && line[0] != '\0') {
! 					/* printf("line = ` %s '\n",line); */
! 					ctlline(line); 
! 				}
! 			}
! 			else {
! 				if (buf[0] != '#' && buf[0] != '\0') {
! 					/* printf("buf = ` %s '\n",buf); */
! 					ctlline(buf); 
! 				}
! 				free(buf);
! 				buf = (char *)0;
! 			}
! 		}
! 		bzero(line,sizeof(line));
  	}
  }
  
--- 255,268 ----
  	char line[200];		/* long enough for any sane line */
  	register char *p;
  	void ctlline();
  
  	while (fgets(line, sizeof(line), f) != NULL) {
  		p = &line[strlen(line) - 1];
  		if (*p != '\n')
  			fail("control line `%.30s...' too long", line);
  		*p = '\0';
! 		if (line[0] != '#' && line[0] != '\0')
! 			ctlline(line);
  	}
  }
  
***************
*** 353,375 ****
  	(void) strcpy(datebuf, field[2]);
  	ndates = split(datebuf, dates, 3, "-");
  	switch (ndates) {
- 	/* i've replaced ' back(atof(dates[0])) ' with backtime()
- 	* backtime checks for an 'n' in the date field... to
- 	* allow a 'never-never-never' expiry specifyer
- 	*/
  	case 3:
! 		ct->retain = backtime(dates[0]);
! 		ct->normal = backtime(dates[1]);
! 		ct->purge = backtime(dates[2]);
  		break;
  	case 2:
  		ct->retain = (bounds != NULL) ? bounds->retain : back(0.0);
! 		ct->normal = backtime(dates[0]);
! 		ct->purge = backtime(dates[1]);
  		break;
  	case 1:
  		ct->retain = (bounds != NULL) ? bounds->retain : back(0.0);
! 		ct->normal = backtime(dates[0]);
  		ct->purge = (bounds != NULL) ? bounds->purge : EPOCH;
  		break;
  	default:
--- 306,324 ----
  	(void) strcpy(datebuf, field[2]);
  	ndates = split(datebuf, dates, 3, "-");
  	switch (ndates) {
  	case 3:
! 		ct->retain = back(atof(dates[0]));
! 		ct->normal = back(atof(dates[1]));
! 		ct->purge = back(atof(dates[2]));
  		break;
  	case 2:
  		ct->retain = (bounds != NULL) ? bounds->retain : back(0.0);
! 		ct->normal = back(atof(dates[0]));
! 		ct->purge = back(atof(dates[1]));
  		break;
  	case 1:
  		ct->retain = (bounds != NULL) ? bounds->retain : back(0.0);
! 		ct->normal = back(atof(dates[0]));
  		ct->purge = (bounds != NULL) ? bounds->purge : EPOCH;
  		break;
  	default:
***************
*** 1345,1359 ****
  	*rp = '\0';
  
  	return(result);
- }
- 
- /* ericm hacks */
- time_t backtime(time)
- char *time;
- {
- 
- 	if (*time == 'n')
- 		return(EPOCH);	/* 'never' */
- 
- 	return(back(atof(time)));
  }
--- 1294,1297 ----


I also changed things a bit to allow a '\' as a line continuation
so I could use my old Bnews expire script.  This diff is from the 25-May-1990
version.


 eric murray           ibmsupt!ericm@uunet.uu.net           uunet!ibmsupt!ericm