                   Automatic Reliable Polling

TERM provides a fully automated, very reliable remote polling 
system, with two scripts named autopoll.cmd, which controls the 
system selection process, and autop2.cmd, which controls the 
connection and file transfer processes.  A configuration file is 
created for each system to be polled.  These files, along with 
all other polling system control files, are kept under one 
common, unique directory on the master system.  On MSDOS and 
UNIX/Xenix, this directory is /usr/term/poll.

Polling requests for each remote system are kept in the polling 
directory, using a special file naming convention.  The requests 
themselves are unique for each system to be polled, and are named 
sysname.nnn where sysname is the system name matching the 
associated sysname.con (configuration) file, and nnn is a three 
digit sequence number, starting at 000.  Each request file is 
actually a term script file, and contains specific file transfer 
(or other) requests for the remote system being called.

The main polling process, autopoll.cmd is run specifying an input 
poll list file, and an output poll list name.  If a poll request 
fails for any reason, autopoll writes the currently connected 
system name to the output poll list file.  This allows the 
autopoll command to be run again with the failed systems at a 
later time, if desired.  At all times, a time-stamped logfile is 
kept in the polling directory, named term.log, for close 
inspection of poll results.

When autopoll runs, it checks the poll directory for poll 
requests.  Remote systems are polled only if a request exists for 
them, and they are specified in autopoll's input file.

Following are more technical details of TERM's automated polling 
system:

INSTALLATION

     1. The polling system is installed after TERM has been fully 
installed.  See TERM's installation instructions to install TERM.  

     2. Create the polling directory.  Type:

          mkdir \usr\term\poll          (for MSDOS)
          mkdir /usr/term/poll          (for UNIX/Xenix)

     3. Create the configuration files for each remote system to 
be polled.  You will need to have a 8-character system name, the 
baud rate, the type of remote system, and the phone number if not 
directly connected.  TERM's pre-built automated file queueing 
menus can be used for this, as documented in TERM's v6.1 Release 
Notes.  Type:

          term q

to start the menu.  Select "Add System", and enter the requested 
information.  Use "TERMCRC" for the file transfer protocol.  
Press the F1 key to accept your entries.  Repeat this process for 
each system.  When done, select the "Quit" option.

Note that the autopoll script works when run from either an MSDOS 
or UNIX/Xenix master.  The remote system types, (MSDOS, UNIX, 
Xenix, BTOS, VMS, etc) are specified in the above described menu.

     4. Copy the system configurations just created to the poll 
directory, as TERM's queuing menu places them in the queuing 
directory, /usr/term/queue.  Type:

     copy \usr\term\queue\*.con  \usr\term\poll   (for MSDOS)
     cp /usr/term/queue/*.con  /usr/term/poll     (for UNIX/Xenix)

     5. Create the poll request files, containing the term script 
commands to complete the requests.  File transfer and receive are 
most common.  For example, to transfer file "test1" to system 
"dos1", and get a file "test2" from system "dos2", the following 
two files would be created, with one line in them:

     "/usr/term/poll/dos1.000":
          XFER test1 .

     "/usr/term/poll/dos2.000":
          GET test1 .

Note that TERM's current directory is assumed for file transfer 
requests that don't specify the full pathname.  The autopoll.cmd 
polling script does not change directory to the poll directory 
automatically.

     6. Create and input poll list, containing one line per 
system to be polled, with the systems name on each line.  For 
example, to poll the two systems above, create the file "infile", 
with the following two lines in it:

          dos1
          dos2

     7. Remote MSDOS systems must be running TERM in server mode 
before the phone call, and if connected by phone, have the phone 
in auto-answer mode.  The provided "autoans.cmd" script performs 
these functions.  This file should be placed in each remote 
system's TERM directory, \usr\term.  On UNIX/Xenix systems, this 
step is not required, as the master TERM can auto-login and start 
the remote TERM server.  The autoans.cmd script looks like this:

     
     8. Run the autopoll.cmd script, specifying the input poll 
list, and an output poll list filename.  The following example 
uses "outfile" as the output poll list.

          term autopoll infile outfile

To run the polling script from UNIX/Xenix CRON, for starting at 
pre-determined times, use the autopoll.sh shell script, which 
sets required environment variables, and executes the above line, 
after setting up shell standard inputs and outputs.
