


     EEEEXXXXPPPPIIIIRRRREEEE((((8888))))		 XXXXEEEENNNNIIIIXXXX 3333....0000 ((((11113333 AAAApppprrrriiiillll 1111999999992222))))	     EEEEXXXXPPPPIIIIRRRREEEE((((8888))))



     NNNNAAAAMMMMEEEE
	  expire, doexpire, expireiflow - expire old news
	  mkhistory - rebuild news history file
	  upact - update news active file
	  recovact - partially recover news active file

     SSSSYYYYNNNNOOOOPPPPSSSSIIIISSSS
	  ////uuuussssrrrr////lllliiiibbbb////nnnneeeewwwwssssbbbbiiiinnnn////eeeexxxxppppiiiirrrreeee////eeeexxxxppppiiiirrrreeee [ ----aaaa archdir ]	[ ----pppp ] [ ----ssss ]
	  [ ----FFFF c ] [ ----cccc	] [ ----nnnn nnnnn ] [ ----tttt ] [	----llll ] [ ----vvvv ] [ ----dddd ] [
	  ----rrrr ] [ ----gggg ] [	----hhhh ] [ controlfile ]
	  ////uuuussssrrrr////lllliiiibbbb////nnnneeeewwwwssssbbbbiiiinnnn////eeeexxxxppppiiiirrrreeee////ddddooooeeeexxxxppppiiiirrrreeee expireoptions
	  ////uuuussssrrrr////lllliiiibbbb////nnnneeeewwwwssssbbbbiiiinnnn////eeeexxxxppppiiiirrrreeee////eeeexxxxppppiiiirrrreeeeiiiifffflllloooowwww minimum expireoptions
	  ////uuuussssrrrr////lllliiiibbbb////nnnneeeewwwwssssbbbbiiiinnnn////eeeexxxxppppiiiirrrreeee////mmmmkkkkhhhhiiiissssttttoooorrrryyyy [ ----ssss sizemultiplier	]
	  ////uuuussssrrrr////lllliiiibbbb////nnnneeeewwwwssssbbbbiiiinnnn////eeeexxxxppppiiiirrrreeee////uuuuppppaaaacccctttt
	  ////uuuussssrrrr////lllliiiibbbb////nnnneeeewwwwssssbbbbiiiinnnn////eeeexxxxppppiiiirrrreeee////rrrreeeeccccoooovvvvaaaacccctttt

     DDDDEEEESSSSCCCCRRRRIIIIPPPPTTTTIIIIOOOONNNN
	  _E_x_p_i_r_e expires old news, removing it from the	current-news
	  directories and (if asked to)	archiving it elsewhere.	 It
	  updates news's _h_i_s_t_o_r_y file to match.	 _E_x_p_i_r_e	should
	  normally be run nightly, typically by	using _d_o_e_x_p_i_r_e (see
	  below).

	  _E_x_p_i_r_e's operations are controlled by	a control file (which
	  can be named or supplied on standard input), which is	not
	  optional-there is no default behavior.  Each line of the
	  control file (except for empty lines and lines starting with
	  `#', which are ignored) should have four white-space-
	  separated fields, as follows.

	  The first field is a newsgroup pattern list (containing no
	  spaces!); partial specifications are acceptable (e.g.	`comp'
	  specifies all	groups with that prefix).  See _n_e_w_s_s_y_s(5) for
	  full details.

	  The second field is one letter, `m', `u', or `x', specifying
	  that the line	applies	only to	moderated groups, only to
	  unmoderated groups, or to both, respectively.

	  The third field specifies the	expiry period in days.	The
	  most general form is three numbers separated by dashes.  The
	  units	are days, decimal fractions are	permitted, and
	  ``never'' is shorthand for an	extremely large	number.	 The
	  first	number gives the retention period: how long must pass
	  after	an article's arrival before it is a candidate for
	  expiry.  The third number gives the purge period: how	long
	  must pass after arrival before the article will be expired
	  unconditionally.  The	middle number gives the	expiry period:
	  how long after an article's arrival it is expired by
	  default.  An explicit	expiry date in the article will
	  override the expiry period but not the retention period or
	  the purge period.  If	the field contains only	two numbers



     Page 1					      (printed 6/4/94)






     EEEEXXXXPPPPIIIIRRRREEEE((((8888))))		 XXXXEEEENNNNIIIIXXXX 3333....0000 ((((11113333 AAAApppprrrriiiillll 1111999999992222))))	     EEEEXXXXPPPPIIIIRRRREEEE((((8888))))



	  with a dash separating them, the retention period defaults
	  to 0.	 If the	field contains only a number, the retention
	  period defaults to 0 and the purge period defaults to
	  `never'.  (But see below.) The retention period must be less
	  than the purge period, and the expiry	period must lie
	  between them.

	  The fourth field is an archiving directory, or `@' which
	  indicates that the default archiving directory (see ----aaaa)
	  should be used, or `-' which suppresses archiving.  An
	  explicit archiving directory (not `@') prefixed with `='
	  means	that articles should be	archived into that directory
	  itself; normally they	go into	subdirectories under it	by
	  newsgroup name, as in	the current-news directory tree.
	  (E.g., article 123 of	comp.pc.drivel being archived into
	  archive directory /_e_x_p would normally	become
	  /_e_x_p/_c_o_m_p/_p_c/_d_r_i_v_e_l/_1_2_3, but if the archiving	directory was
	  given	as `=/exp' rather than `/exp', it would	become
	  /_e_x_p/_1_2_3.) _E_x_p_i_r_e creates subdirectories under an archiving
	  directory automatically, but will not	create the archiving
	  directory itself.  Archiving directories must	be given as
	  full pathnames.

	  The first line of the	control	file which applies to a	given
	  article is used to control its expiry.  It is	an error for
	  no line to apply; the	last line should be something like
	  `all x 7 -' to ensure	that at	least one line is always
	  applicable.  Cross-posted articles are treated as if they
	  were independently posted to each group.

	  The retention	and purge defaults can be overridden by
	  including a _b_o_u_n_d_s line, one with the	special	first field
	  ////bbbboooouuuunnnnddddssss////.  The retention and purge defaults for following
	  lines	will be	those of the bounds line.  The defaults
	  ``stretch'' as necessary to ensure that the purge period is
	  never	less than the expiry period and	the retention period
	  is never greater than	the expiry period.  The	other fields
	  of a bounds line are ignored but must	be present.

	  Entries in the _h_i_s_t_o_r_y file can be retained after article
	  expiry, to stop a late-arriving copy of the article from
	  being	taken as a new article.	 To arrange this, include a
	  line with the	special	first field ////eeeexxxxppppiiiirrrreeeedddd////; this line then
	  controls the expiry of _h_i_s_t_o_r_y lines after the corresponding
	  articles expire.  Dates are still measured from article
	  arrival, not expiry.	The other fields of such a line	are
	  ignored but must be present.	It is strongly recommended
	  that such a line be included,	and that it specify as long a
	  time as practical.

	  Command-line options are:




     Page 2					      (printed 6/4/94)






     EEEEXXXXPPPPIIIIRRRREEEE((((8888))))		 XXXXEEEENNNNIIIIXXXX 3333....0000 ((((11113333 AAAApppprrrriiiillll 1111999999992222))))	     EEEEXXXXPPPPIIIIRRRREEEE((((8888))))



	  ----aaaa dir    _d_i_r	is the default archiving directory; if no
		    default is given, the control file may not contain
		    any	`@' archive-directory fields.

	  ----pppp	    print an `index' line for each archived article,
		    containing its pathname, message ID, date
		    received, and `Subject:' line.

	  ----ssss	    space is tight; optimize error recovery to
		    minimize space consumed rather than	to leave as
		    much evidence as possible.

	  ----FFFF c	    the	subfield separator character in	the middle
		    _h_i_s_t_o_r_y field is _c rather than the normal `~'.

	  ----cccc	    check the format and consistency of	the control
		    file and the _a_c_t_i_v_e	file, but do not do any
		    expiring.

	  ----nnnn nnnnn  set	_e_x_p_i_r_e's idea of the time to _n_n_n_n_n (for
		    testing).

	  ----tttt	    print (on standard error) a	shell-script-like
		    description	of what	would be done, but don't do
		    it.	 In the	absence	of archiving, all output lines
		    will be of the form	``rrrreeeemmmmoooovvvveeee _n_a_m_e'', where _n_a_m_e is
		    a pathname relative	to /_u_s_r/_s_p_o_o_l/_n_e_w_s.  If	an
		    article is to be archived, this will be preceded
		    (on	the same line) by ``ccccooooppppyyyy _n_a_m_e _d_i_r ;;;; '',	where
		    _n_a_m_e is as in rrrreeeemmmmoooovvvveeee and _d_i_r is an archiving
		    directory (including any `=' prefix) as specified
		    by the control file	or the ----aaaa option.

	  ----llll	    consider first filename in a _h_i_s_t_o_r_y line to be
		    the	_l_e_a_d_e_r of its line, to be expired only after
		    all	others have expired.  (Meant for use on
		    obnoxious systems like VMS which don't support
		    real links.)

	  ----rrrr	    suppress _h_i_s_t_o_r_y rebuild.  Mostly for emergencies.
		    (This leaves the _h_i_s_t_o_r_y file out of date and
		    larger than	necessary, but improves	speed and
		    eliminates the need	for several megabytes of
		    temporary storage.)

	  ----hhhh	    do not expire any article which would be archived
		    if it were expired.	 Mostly	for emergencies, so
		    that _e_x_p_i_r_e	can be run (to delete articles in
		    non-archived groups) even if space is short	in
		    archiving areas.

	  ----vvvv	    verbose: report some statistics after termination.



     Page 3					      (printed 6/4/94)






     EEEEXXXXPPPPIIIIRRRREEEE((((8888))))		 XXXXEEEENNNNIIIIXXXX 3333....0000 ((((11113333 AAAApppprrrriiiillll 1111999999992222))))	     EEEEXXXXPPPPIIIIRRRREEEE((((8888))))



	  ----gggg	    report expiry dates	that _g_e_t_d_a_t_e(3)	does not like.
		    _E_x_p_i_r_e ignores such	dates, treating	the article as
		    if it had no explicit expiry date.

	  ----dddd	    turn on (voluminous	and cryptic) debugging output.

	  _E_x_p_i_r_e considers the middle field of a _h_i_s_t_o_r_y line to
	  consist of one or more subfields separated by	`~'.  The
	  first	is the arrival date, which can be either a
	  _g_e_t_d_a_t_e(3)-readable date or a	decimal	seconds	count; _e_x_p_i_r_e
	  leaves this field unchanged.	The second-if present, non-
	  null,	and not	`-'-is an explicit expiry date for the file,
	  again	in either format, which	_e_x_p_i_r_e will convert to a
	  decimal seconds count	as it regenerates the _h_i_s_t_o_r_y file.
	  Subsequent fields are	preserved but ignored.

	  _D_o_e_x_p_i_r_e checks whether another _d_o_e_x_p_i_r_e is running, checks
	  that there is	enough disk space, invokes _e_x_p_i_r_e with any
	  _e_x_p_i_r_e_o_p_t_i_o_n_s	given and with /_u_s_r/_l_i_b/_n_e_w_s/_e_x_p_l_i_s_t as	the
	  control file,	and reports any	difficulties by	sending	mail
	  to _u_s_e_n_e_t.  This is usually better than just running _e_x_p_i_r_e
	  directly.  If	space is not adequate for archiving, _d_o_e_x_p_i_r_e
	  reports this and invokes _e_x_p_i_r_e with the ----hhhh option.  If ----rrrr
	  is not among the _e_x_p_i_r_e_o_p_t_i_o_n_s, and disk space is
	  persistently inadequate for the temporaries needed for
	  history rebuilding, _d_o_e_x_p_i_r_e reports this and	invokes	_e_x_p_i_r_e
	  with the ----rrrr option anyway.

	  _E_x_p_i_r_e_i_f_l_o_w checks whether there are at least	_m_i_n_i_m_u_m
	  megabytes available for articles, and	invokes	_d_o_e_x_p_i_r_e with
	  ----rrrr and the _e_x_p_i_r_e_o_p_t_i_o_n_s (if any) if not.  This may be
	  useful on systems which run close to the edge	on disk	space.

	  _M_k_h_i_s_t_o_r_y rebuilds the _h_i_s_t_o_r_y file and its auxiliaries to
	  match	the articles in	/_u_s_r/_s_p_o_o_l/_n_e_w_s.  Normally _m_k_h_i_s_t_o_r_y
	  uses a reasonable default size for the _d_b_z(3z) index
	  database; if the ----ssss option is	given, the expected number of
	  entries in the history database is taken to be the number of
	  articles found in /_u_s_r/_s_p_o_o_l/_n_e_w_s times _s_i_z_e_m_u_l_t_i_p_l_i_e_r.

	  _U_p_a_c_t	updates	the third fields of the	_a_c_t_i_v_e file to match
	  the articles in /_u_s_r/_s_p_o_o_l/_n_e_w_s (for historical reasons,
	  _e_x_p_i_r_e does not do this).  _R_e_c_o_v_a_c_t updates the second
	  fields of the	_a_c_t_i_v_e file to match the articles in
	  /_u_s_r/_s_p_o_o_l/_n_e_w_s, for use in disaster recovery	based on an
	  outdated _a_c_t_i_v_e file or initialization of a news system
	  based	on someone else's _a_c_t_i_v_e.

	  _M_k_h_i_s_t_o_r_y, _u_p_a_c_t, and	_r_e_c_o_v_a_c_t are all fairly	slow and they
	  all lock the whole news system for the duration of the run,
	  so they should not be	run casually.




     Page 4					      (printed 6/4/94)






     EEEEXXXXPPPPIIIIRRRREEEE((((8888))))		 XXXXEEEENNNNIIIIXXXX 3333....0000 ((((11113333 AAAApppprrrriiiillll 1111999999992222))))	     EEEEXXXXPPPPIIIIRRRREEEE((((8888))))



     FFFFIIIILLLLEEEESSSS
	  /usr/lib/news/history	  history file
	  /usr/lib/news/history.pag_d_b_m database	for history file
	  /usr/lib/news/history.dir_d_b_m database	for history file
	  /usr/lib/news/explist	  expiry control file
	  /usr/lib/news/history.o history file as of last expiry
	  /usr/lib/news/history.n*new history file and _d_b_m files abuilding
	  /usr/lib/news/LOCKexpire_d_o_e_x_p_i_r_e's lock file
	  /usr/lib/newsbin/expire/*various auxiliaries

     SSSSEEEEEEEE AAAALLLLSSSSOOOO
	  _i_n_e_w_s(1), _d_b_m(3), _n_e_w_s_s_y_s(5),	_r_e_l_a_y_n_e_w_s(8)

     HHHHIIIISSSSTTTTOOOORRRRYYYY
	  Written at U of Toronto by Henry Spencer, with contributions
	  by Geoff Collyer.

     BBBBUUUUGGGGSSSS
	  Archiving is always done by copying, never by	linking.  This
	  has the side effect that cross-posted	articles are archived
	  as several independent copies.

	  The ----pppp subject-finder	botches	continued header lines,	as
	  does _m_k_h_i_s_t_o_r_y, although such	lines are rare.

	  _U_p_a_c_t	is a distasteful kludge, but then, so is the third
	  field	of the _a_c_t_i_v_e file.

	  _U_p_a_c_t	forces the third field of the _a_c_t_i_v_e file to be	at
	  least	five digits, for backward compatibility, but otherwise
	  just makes it	as large as necessary.	The group-creation
	  operations always create it ten digits long.	The
	  discrepancy is harmless, since unlike	the second field, the
	  third	field is never updated in place.

	  One cannot put more than one newsgroup into a	single
	  archiving directory with the `=' feature, since the article
	  numbers will collide with each other and expire doesn't do
	  anything about this.	Note that archiving a newsgroup	which
	  has subgroups	into an	`=' directory puts all the subgroups
	  in the same directory	as the parent!	(Specifying the	group
	  as `foo.bar,!foo.bar.all' will avoid this.)

	  _M_k_h_i_s_t_o_r_y is inherently incapable of reconstructing
	  history-file lines corresponding to expired articles.
	  Protection against old articles reappearing is thus somewhat
	  limited for a	while after the	history	file is	rebuilt.

	  _E_x_p_i_r_e uses _a_c_c_e_s_s(2)	to test	for the	presence of archiving
	  directories, which can cause anomalies if it is run setuid
	  (normally it's not).




     Page 5					      (printed 6/4/94)



