


     NNNNEEEEWWWWSSSSBBBBAAAATTTTCCCCHHHH((((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 ((((22227777 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))))	  NNNNEEEEWWWWSSSSBBBBAAAATTTTCCCCHHHH((((8888))))



     NNNNAAAAMMMMEEEE
	  sendbatches, batchsplit - news batching to other sites
	  batcher, batchih, batchsm, batchra - news-batch preparation
	  comp, comp12, nocomp, compcun, compc7, compb - news-batch compression
	  c7encode, bencode - compressed-news-batch encoding
	  viauux, viauuxz, viauuxcun, viauuxl - news-batch transmission via uucp
	  viamail, viaemail, viapmail - news-batch transmission via mail
	  viainews, viarsh, vianowhere - news-batch transmission by misc. means

     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////bbbbaaaattttcccchhhh////sssseeeennnnddddbbbbaaaattttcccchhhheeeessss [ ----pppp ] [ site ... ]

	  ............////bbbbaaaattttcccchhhhsssspppplllliiiitttt batchsize
	  ............////bbbbaaaattttcccchhhheeeerrrr listfile
	  ............////bbbbaaaattttcccchhhhiiiihhhh listfile
	  ............////bbbbaaaattttcccchhhhssssmmmm listfile
	  ............////bbbbaaaattttcccchhhhrrrraaaa listfile
	  ............////ccccoooommmmpppp
	  ............////ccccoooommmmpppp11112222
	  ............////nnnnooooccccoooommmmpppp
	  ............////ccccoooommmmppppccccuuuunnnn
	  ............////ccccoooommmmppppcccc7777
	  ............////ccccoooommmmppppbbbb
	  ............////cccc7777eeeennnnccccooooddddeeee
	  ............////bbbbeeeennnnccccooooddddeeee [	file ]
	  ............////vvvviiiiaaaauuuuuuuuxxxx site
	  ............////vvvviiiiaaaauuuuuuuuxxxxzzzz site
	  ............////vvvviiiiaaaauuuuuuuuxxxxccccuuuunnnn	site
	  ............////vvvviiiiaaaauuuuuuuuxxxxllll group
	  ............////vvvviiiiaaaammmmaaaaiiiillll site
	  ............////vvvviiiiaaaaeeeemmmmaaaaiiiillll site
	  ............////vvvviiiiaaaappppmmmmaaaaiiiillll site
	  ............////vvvviiiiaaaaiiiinnnneeeewwwwssss site
	  ............////vvvviiiiaaaarrrrsssshhhh site
	  ............////vvvviiiiaaaannnnoooowwwwhhhheeeerrrreeee site

     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
	  _S_e_n_d_b_a_t_c_h_e_s administers batched transmission of news to
	  other	sites.	It should be run periodically, under userid
	  _n_e_w_s,	by _c_r_o_n(8) or similar means.  It prepares and sends
	  batches of news, subject to restrictions on available	space
	  and length of	outbound queues.

	  Normally, _s_e_n_d_b_a_t_c_h_e_s	does locking to	ensure that only one
	  _s_e_n_d_b_a_t_c_h_e_s is running at a time.  The ----pppp option suppresses
	  the locking and permits parallel _s_e_n_d_b_a_t_c_h_e_s runs, although
	  lower-level locking is done to ensure	that only one is
	  trying to prepare batches for	any particular site at a given



     Page 1					      (printed 6/4/94)






     NNNNEEEEWWWWSSSSBBBBAAAATTTTCCCCHHHH((((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 ((((22227777 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))))	  NNNNEEEEWWWWSSSSBBBBAAAATTTTCCCCHHHH((((8888))))



	  time.	 Parallel _s_e_n_d_b_a_t_c_h_e_s runs impose very heavy system
	  loads	but may	be useful to systems with extensive hardware
	  parallelism and many outbound	news feeds.

	  Each site that can have batches sent to it needs a _s_i_t_e
	  directory under /_u_s_r/_s_p_o_o_l/_n_e_w_s/_o_u_t._g_o_i_n_g.  If _s_e_n_d_b_a_t_c_h_e_s
	  is invoked with specific _s_i_t_es given,	it considers batching
	  for those sites, only, in that order.	 By default,
	  _s_e_n_d_b_a_t_c_h_e_s consults the _b_a_t_c_h_p_a_r_m_s file (see	below) to
	  determine what to do:	If there is a ////ddddeeeeffffaaaauuuulllltttt////	entry in
	  _b_a_t_c_h_p_a_r_m_s, _s_e_n_d_b_a_t_c_h_e_s will consider	batching for all sites
	  that have directories	in /_u_s_r/_s_p_o_o_l/_n_e_w_s/_o_u_t._g_o_i_n_g, in
	  oldest-first order by	modification time of the directory.
	  If there is no ////ddddeeeeffffaaaauuuulllltttt//// entry, _s_e_n_d_b_a_t_c_h_e_s considers
	  batching for those sites named in _b_a_t_c_h_p_a_r_m_s,	in the order
	  named.

	  To use the batcher, names of files to	be sent	to a specific
	  site should be appended to a _t_o_g_o file in its	_s_i_t_e
	  directory.  The batcher expects the lines in _t_o_g_o to have
	  two fields, a	filename (as a full pathname, or relative to
	  /_u_s_r/_s_p_o_o_l/_n_e_w_s) of an article and its size in bytes.	 A
	  missing size field is	arbitrarily assumed to be a default
	  average.

	  _S_e_n_d_b_a_t_c_h_e_s uses a number of auxiliary programs to do	the
	  real work.  The search path it uses to find them includes,
	  in order, the	_s_i_t_e directory for the site in question,
	  /_u_s_r/_l_i_b/_n_e_w_s/_b_i_n, and /_u_s_r/_l_i_b/_n_e_w_s_b_i_n/_b_a_t_c_h.  This permits
	  per-site and per-news-database overrides of the default
	  behaviors.  _S_e_n_d_b_a_t_c_h_e_s provides all these programs with
	  environment variables	NNNNEEEEWWWWSSSSSSSSIIIITTTTEEEE, containing the name of the
	  site that batches are	being prepared for, and	NNNNEEEEWWWWSSSSSSSSIIIITTTTEEEEDDDDIIIIRRRR,
	  containing the full pathname of the _s_i_t_e directory, in case
	  these	are useful in customization.

	  The names of most of the auxiliary programs, and some	other
	  parameters, are taken	from the file
	  /_u_s_r/_l_i_b/_n_e_w_s/_b_a_t_c_h_p_a_r_m_s, an ASCII text file.	 Empty lines
	  and lines starting with `#' are ignored.  Other lines
	  specify the behavior for sites, one line per site.  A	site
	  line is six fields, separated	by white space.	 The first
	  field	is the site name; a line whose site name is ////ddddeeeeffffaaaauuuulllltttt////
	  specifies what parameters should be used for sites not
	  explicitly mentioned.	 (The presence or absence of such a
	  line also influences the behavior of _s_e_n_d_b_a_t_c_h_e_s when
	  invoked without arguments; see above.) The second field is
	  the size of batches to be prepared (before compression), in
	  bytes.  The third field is the maximum length	of the output
	  queue	for transmission to that site.	The fourth, fifth, and
	  sixth	fields are the names of	the programs to	be used	to
	  build, compress, and transmit	(respectively) batches to that



     Page 2					      (printed 6/4/94)






     NNNNEEEEWWWWSSSSBBBBAAAATTTTCCCCHHHH((((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 ((((22227777 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))))	  NNNNEEEEWWWWSSSSBBBBAAAATTTTCCCCHHHH((((8888))))



	  site.

	  For each site	being considered for batches, _s_e_n_d_b_a_t_c_h_e_s
	  first	determines whether there are in	fact any articles to
	  be batched.  Assuming	there are, _s_e_n_d_b_a_t_c_h_e_s then finds the
	  _b_a_t_c_h_p_a_r_m_s line for that site	and invokes _q_u_e_u_e_l_e_n (see
	  _n_e_w_s_a_u_x(8)) to find out the size of the outbound queue for
	  the site.  _S_e_n_d_b_a_t_c_h_e_s limits	the number of batches prepared
	  to the minimum of the	limits implied by queue	lengths	and
	  available space.

	  _S_e_n_d_b_a_t_c_h_e_s uses _b_a_t_c_h_s_p_l_i_t as necessary to slice chunks out
	  of the _t_o_g_o file, each chunk containing the _t_o_g_o lines for a
	  batch	limited	to the specified size.	Exception:  a single
	  article bigger than the specified size will still go out as
	  one batch.

	  Each chunk is	then processed through a batch preparer
	  (typically _b_a_t_c_h_e_r), which assembles the articles into a
	  batch, a batch compressor (typically _c_o_m_p_c_u_n), which
	  performs compression and/or any other	auxiliary processing
	  needed, and a	batch transmitter (typically _v_i_a_u_u_x), which
	  sends	the batch on its way (e.g. enqueues it for
	  transmission).  The preparer is run with /_u_s_r/_s_p_o_o_l/_n_e_w_s as
	  the current directory, so non-absolute pathnames in the
	  chunk	are valid filenames; the others	are run	in the _s_i_t_e
	  directory for	easier access to site-specific customization
	  files.

	  Batch	preparers in the standard distribution are:

	       batcher	normal batching

	       batchih	_i_h_a_v_e-sending part of uucp ihave/sendme	(not
			to be confused with NNTP)

	       batchsm	_s_e_n_d_m_e-sending part of ihave/sendme

	       batchra	requested-article-sending part of ihave/sendme

	  _B_a_t_c_h_i_h, _b_a_t_c_h_s_m, and	_b_a_t_c_h_r_a	have to	map from the phony
	  ``site name''	given in their _b_a_t_c_h_p_a_r_m_s line to the name of
	  the site they	should actually	send to; they do this by
	  stripping off	the last `.' and everything that follows
	  (usually `.ihave' or `.sendme' respectively, but on machines
	  which	limit the size of filenames these may have to be
	  shortened).

	  Caution: _b_a_t_c_h_i_h and _b_a_t_c_h_s_m do their	work by	constructing
	  an article and feeding it to _i_n_e_w_s, which means that the
	  batch	size must be within what _i_n_e_w_s will accept (see
	  _i_n_e_w_s(1)).



     Page 3					      (printed 6/4/94)






     NNNNEEEEWWWWSSSSBBBBAAAATTTTCCCCHHHH((((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 ((((22227777 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))))	  NNNNEEEEWWWWSSSSBBBBAAAATTTTCCCCHHHH((((8888))))



	  Batch	compressors in the standard distribution are:

	       comp	ordinary compression

	       comp12	12-bit compression (for	sites with limited
			decompression ability)

	       compcun	compression plus the silly B-news-compatible
			`#! cunbatch' header

	       nocomp	pass data straight through, no compression

	       compc7	compression plus 7-bit encoding	using _c_7_e_n_c_o_d_e

	       compb	compression plus very conservative 6-bit
			encoding using _b_e_n_c_o_d_e

	  Batch	transmitters in	the standard distribution are:

	       viauux	 normal	transmission via UUCP

	       viauuxz	 like _v_i_a_u_u_x except with ----zzzz option given to
			 _u_u_x (for old UUCPs where don't-report-
			 result-on-zero-status is not default)

	       viauuxcun like _v_i_a_u_u_x except it invokes _c_u_n_b_a_t_c_h	rather
			 than _r_n_e_w_s at the other end (for some very
			 old news sites)

	       viauuxl	 multicast transmission	using the ----llll option of
			 _u_u_x (not found	on all systems)	to send	the
			 same batch to all systems listed in the file
			 `/usr/lib/news/sites._g_r_o_u_p'

	       viamail	 mail the batch	to _s_i_t_e!!!!rrrrnnnneeeewwwwssss

	       viaemail	 mail the batch	to _s_i_t_e!!!!eeeennnneeeewwwwssss

	       viapmail	 mail the batch	to _s_i_t_e!!!!rrrrnnnneeeewwwwssss, attempting to
			 protect an unencoded batch against the
			 vagaries of mailers

	       viainews	 feed the batch	back to	_i_n_e_w_s, ignoring	the
			 _s_i_t_e argument (normally useful	only for
			 ihave/sendme)

	       viarsh	 use _r_s_h to run	_r_n_e_w_s on the _s_i_t_e via
			 Ethernet, Internet, etc.  (the	directory
			 containing _r_n_e_w_s must be in the default PATH
			 on _s_i_t_e)

	       vianowhere



     Page 4					      (printed 6/4/94)






     NNNNEEEEWWWWSSSSBBBBAAAATTTTCCCCHHHH((((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 ((((22227777 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))))	  NNNNEEEEWWWWSSSSBBBBAAAATTTTCCCCHHHH((((8888))))



			 dummy transmitter for batchers	like _b_a_t_c_h_r_a
			 that don't need a real	one

	  _C_7_e_n_c_o_d_e encodes 8-bit data from standard input into a 7-bit
	  form optimized for transmission by uucp `f' protocol.	 The
	  encoding is complex and bizarre.

	  _B_e_n_c_o_d_e takes	8-bit data from	the named source file (the
	  default is standard input) and encodes it using only the
	  ASCII	characters ``A'' - ``Z'', ``a''	- ``z'', ``0'' -
	  ``9'', ``+'',	and ``-''.  The	ASCII characters blank,
	  newline, and ``/'' also appear in the	encoded	file, but do
	  not represent	encoded	bits.  The encoded file	is terminated
	  with a byte count and	cyclic redundancy check	for detecting
	  corrupted files.  This ought to suffice to get data through
	  almost any network.

	  _S_e_n_d_b_a_t_c_h_e_s logs some	information about sites	with backlogs
	  in /_u_s_r/_l_i_b/_n_e_w_s/_b_a_t_c_h_l_o_g (see also _n_e_w_s_d_a_i_l_y(8)).  This is
	  intended to help detection and diagnosis of flow problems.

     FFFFIIIILLLLEEEESSSS
	  /usr/lib/news/LOCKbatch	    overall lock for _s_e_n_d_b_a_t_c_h_e_s
	  /usr/lib/news/LOCK		    overall news lock (used by _b_a_t_c_h_s_p_l_i_t)
	  /usr/lib/news/L.*		    lock temporaries
	  /usr/spool/news/out.going/*	    batch directories
	  /usr/spool/news/out.going/*/LOCK  per-site locks
	  /usr/spool/news/out.going/*/L.*   per-site lock temporaries
	  /usr/lib/news/batchparms	    parameter file
	  /usr/lib/news/sites.*		    _v_i_a_u_u_x_l multicast lists

	  also see text

     SSSSEEEEEEEE AAAALLLLSSSSOOOO
	  inews(1), compress(1), uux(1), relaynews(8), rnews(8)

     DDDDIIIIAAAAGGGGNNNNOOOOSSSSTTTTIIIICCCCSSSS
	  Complaints, if any, from _s_e_n_d_b_a_t_c_h_e_s and its auxiliaries are
	  mailed to `usenet'.

     HHHHIIIISSSSTTTTOOOORRRRYYYY
	  Written at University	of Toronto as part of the C News
	  project.  A number of	the ideas came from Chris Lewis, who
	  was then with	Motorola.  _B_e_n_c_o_d_e written at University of
	  Waterloo by Reg Quinton and Ken Lalonde.

     BBBBUUUUGGGGSSSS
	  _S_e_n_d_b_a_t_c_h_e_s estimates	available space	without	considering
	  the effects of compression; this is usually too
	  conservative.

	  _V_i_a_p_m_a_i_l is obsolescent; _v_i_a_e_m_a_i_l with a batch encoded with



     Page 5					      (printed 6/4/94)






     NNNNEEEEWWWWSSSSBBBBAAAATTTTCCCCHHHH((((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 ((((22227777 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))))	  NNNNEEEEWWWWSSSSBBBBAAAATTTTCCCCHHHH((((8888))))



	  _b_e_n_c_o_d_e is vastly superior.

	  Queue-length limiting	does not work for _v_i_a_u_u_x_l because
	  _q_u_e_u_e_l_e_n (see	_n_e_w_s_a_u_x(8)) does not know about	multicast
	  groups.  Also, _v_i_a_u_u_x_l has not been tested well.

	  _V_i_a_r_s_h does not incorporate a	spooling subsystem, so a slow
	  site stalls the entire batching system and a non-responding
	  site loses news.  It is not recommended for bulk
	  transmission or where	high reliability is essential.













































     Page 6					      (printed 6/4/94)



