home *** CD-ROM | disk | FTP | other *** search
/ Source Code 1992 March / Source_Code_CD-ROM_Walnut_Creek_March_1992.iso / usenet / altsrcs / 2 / 2317 / README < prev    next >
Encoding:
Text File  |  1990-12-28  |  13.0 KB  |  306 lines

  1.  
  2.                 AutoFtp Version 3.0
  3.              (Previously GET21)
  4.  
  5.                       FreeWare
  6.  
  7.                  Mingqi Deng
  8.                 July 6, 1989
  9.  
  10.  
  11.                  Contents
  12.     1) .......................................... Description
  13.     2) .............................. Contents of Version 3.0
  14.     3) ............................................... Set Up
  15.     4) ............................................ Execution
  16.     5) .............................................. History
  17.     
  18.  
  19.    AutoFtp is a UNIX Bourne shell program that automates the ftp processes
  20. to get a number of files from a site that allows ftp file transfer. It 
  21. will repeatedly try for a good connection until all the files requested
  22. are transferred.  A user need not baby-sit the ftp process, thus is 
  23. relieved from the frustration of numerous unsuccessful ftp attempts. 
  24.  
  25.    The program is based on GET20 ftp script by Ferd Boundick, and was 
  26. originally written for my own use after a long suffering from ftp into 
  27. SIMTEL20.  It has been fully tested. This release has the following new
  28. features:
  29.  
  30.    1) A bug that allows a request for a non-existing file to go on
  31.       forever has been fixed.
  32.    2) Users now can run a process of name [*]sleep[*] while running the
  33.       autoftp without having any interferences in between. This is
  34.       because the new version of autoftp uses process ID in its actions
  35.       instead of their names as in the old version.
  36.    3) Changing local directory during ftp and getting directory list are
  37.       supported now.
  38.    4) This versio will not affect the .netrc file. It simply avoids
  39.       using it.
  40.    5) A randomized retry timing sequence has been implemented. In the 
  41.       previous version, there is a chance that several copies of the 
  42.       auto-ftp can get into synchrony. Consequently, none of them can get 
  43.       logged into SIMTEL20. This release minimizes this possibility and
  44.       also smoothes the load at SIMTEL20 thus all users will have a better
  45.       chance to login to SIMTEL20 on the average.
  46.    6) More and better error handlings are implemented. In particular, 
  47.       it will complain if the ALARM is too small for a large file. 
  48.    7) The awkward run.sh file in release 2.1 has been replaced by a 
  49.       simpler input file.
  50.    8) The number of working files is reduced to 5 for the entire run
  51.       from 5 for each file requested. Moreover, there is just one
  52.       file for the entire ftp history instead one for each file
  53.       requested.
  54.  
  55.    This release is a complete rewriting of the previous version, as 
  56. a result of my discussion with Keith Peterson at SIMTEL20. The major 
  57. part of the shell script has been replaced by three C programs. This 
  58. provides a more natural and better program structure, thus more freedom
  59. in analyzing each ftp session.
  60.  
  61.    This is a freeware, meaning that it can be copied and used freely. 
  62. But the programs must NOT be sold for profit.
  63.  
  64.    Problems, improvements, comments and suggestions can be sent to the
  65. author at:
  66.  
  67. E-mail:                Postal Mail:
  68.  
  69.   deng@shire.cs.psu.edu              333 Whitmore Lab
  70.   deng@psuvaxs.bitnet          Computer Science Department
  71.   deng@psuvaxs.uucp          The Pennsylvania State University
  72.                   University Park, PA 16802
  73. ========================================================================
  74.  
  75. All of the files contained in version 3.0 are:
  76.  
  77.        README        this file
  78.        autoftp30.sh  the main program
  79.        nextfile.c    used by autoftp30.sh to prepare for an ftp attempt
  80.        ftpget.c      used by autoftp30.sh for one ftp attempt
  81.        checkout.c    used by autoftp30.sh to analyze an ftp's result
  82.         sample.dat    a sample input data file for autoftp30.sh,
  83.               consisting of a name list of the requested files
  84.               to be transferred from WSMR-SIMTEL20.ARMY.MIL.
  85.  
  86. ========================================================================
  87.  
  88. Set Up:
  89.  
  90.   1. Do a "man ftp" to see if the constant TENEX defined on line 49 in 
  91.      nextfile.c needs to be adjusted. Refer to Note #2 in the head 
  92.      comment block in nextfile.c for more instructions.
  93.  
  94.   2. Compile the three C programs by typing:
  95.  
  96.            cc -o checkout checkout.c
  97.            cc -o ftpget   ftpget.c
  98.            cc -o nextfile nextfile.c
  99.  
  100.      This will produce three executable files named "checkout", "ftpget"
  101.      and "nextfile".
  102.  
  103.      *NOTE*: Each of the programs has a "Note" section in their head
  104.          comment block that provides information about the pre-
  105.          defined constants used in the program. If anything goes
  106.          suspiciously, adjust them properly.
  107.  
  108.   3. Place the three compiled C programs in a directory of your choice.
  109.      However, if the directory is not named "bin" and in your home 
  110.      directory, you will have to adjust the shell variable FtpLibDir
  111.      in autoftp30.sh (cf. autoftp30.sh). The default is $HOME/bin. For
  112.      example, if your home directory is "/usr/usr/deng", then the 
  113.      default directory is "/usr/usr/deng/bin".
  114.  
  115.   4. Adjust the following three shell variables in autoftp30.sh:
  116.  
  117.              RemoteHost, ALARM, FtpLibDir
  118.  
  119.      Instructions and examples are given in autoftp30.sh.
  120.    
  121.      *NOTE*: You may have to change LocalHost in autoftp30.sh (on the
  122.          lines next to RemoteHost) from "guest" to your machine's
  123.          address, if login to SIMTEL20 is always denied. Refer
  124.          to autoftp30.sh.
  125.  
  126.   5. If you have any executable files of your own of the following names:
  127.  
  128.          cat chmod cp echo expr grep mv rm sed sh sleep test
  129.  
  130.      then rename them using different names. These are UNIX commands'
  131.      names, thus should not be taken over by a user's own executables.
  132.  
  133. ========================================================================
  134.  
  135. Execution:
  136.  
  137.   1. Prepare an input file that contains a name list of files you want
  138.      to get from a remote host (cf. sample.dat). The file consists of 
  139.      two types of lines: device-directory line (DDL) and file-line (FL).
  140.  
  141.      a) Device-directory line (DDL):
  142.         Format:   
  143.           -d|c|l  device_directory_name [dir_file]
  144.        where 
  145.           d,c,l are flags indicating a DDL line:
  146.             "-d" :- the name on that line is a device_directory_name
  147.             that defines the directory where a subsequently
  148.             requested file resides, at the remote host.
  149.             This flag requires one name after the option.
  150.             "-c" :- a request to change the local directory so that
  151.             requested files will be put into that directory.
  152.             The name on that line is an existing local
  153.             directory. This flag requires zero or one name 
  154.             after the option. If no name is followed, then
  155.             a change to the home directory is performed.
  156.             "-l" :- a request to obtain a directory listing for the
  157.             remote directory named on that line. This flag
  158.             requires two names after the option: the name
  159.             of the remote directory, and the name of the
  160.             file to which the listing is to be stored.
  161.         Example:
  162.         -d PD1:<MSDOS.DSKUTL>
  163.         -l PD:<ANONYMOUS> root.dirlst
  164.          -c download
  165.         Function:
  166.             A "-d" DDL line defines the directory from which all files 
  167.             on the subsequent file-lines, up to a new "-d" DDL line,
  168.         are to be fetched.
  169.             A "-l" DDL line gets a directory listing to aid the download.
  170.         A "-c" DDL line changes the local directory PERMANENTLY upto
  171.         the next "-c" DDL line to help organize the downloaded 
  172.         file.
  173.  
  174.       *NOTE*: PS:<ANONYMOUS> directory contains general information
  175.           and many directory lists at SIMTEL20. New users are
  176.           particularly encouraged to look into this directory.
  177.  
  178.      b) File lines (FL):
  179.          Format:
  180.                [-a|b|8|t] RemoteFile [LocalFile]
  181.              where:
  182.                 a,b,8,t are flags:
  183.                 "-a" :- a file is to be transferred in ASCII mode 
  184.               "-b" :- a file is to be transferred in binary mode 
  185.               "-t" or "-8" 
  186.                 :- a file is to be transferred in tenex mode
  187.                 (32->8 bits conversion, which is the mode
  188.                 you should use if you are ftp'ing into
  189.                 SIMTEL20 from a DEC VAX or a SUN)
  190.            The option can be omitted (indicated by the bracket
  191.            "[","]".) If it is omitted, the default is "-t" 
  192.            (identical to "-8").
  193.              RemoteFile is the requested file's name at the remote host
  194.              LocalFile (optional) is the file name under which the 
  195.            RemoteFile is to be received at the local machine.
  196.                    If it is omitted, the default is RemoteFile.
  197.          Examples:
  198.         -a     00-INDEX.TXT  DSKUTL.IDX
  199.         -8     BACKEZ.ARC
  200.         DISCACHE.ARC    CACHE.ARC
  201.         TIMEPARK.ARC
  202.         -a    VDSK.ASM
  203.      Functions:
  204.           An FL line specifies the name of a requested file (whose
  205.           directory is specified by a preceding DDL line), and the
  206.           transfer mode for the file.
  207.  
  208.       *NOTE* 1) An option on an FL line must NOT be omitted if the 
  209.         RemoteFile starts with a "-". And only the first letter
  210.         of an option is effective.
  211.              2) Options and names are separated by blanks or TABs.
  212.         No other delimiters can be used. 
  213.          3) There can be more than one blank or TAB between the 
  214.         options and names. 
  215.          4) There can be blanks or TABs before an option. But 
  216.         nothing should be inserted between "-" and a flag.
  217.          5) A DDL or FL line can appear anywhere in an input file
  218.         though some sequence may not be meaningful.
  219.          6) The input file may contain any number of blank line
  220.         anywhere. They are simply ignored.
  221.          7) The file name on an FL line, and directory names on a 
  222.         "-d" or "-l" DDL line can be either in lower or upper 
  223.         case. This makes no difference as far as autoftp30.sh is
  224.         concerned. However, all options must be in lower case.
  225.     
  226.   2. Run the program: 
  227.      There are two ways:
  228.         i) run as a background job (strongly recommended) by typing:
  229.           sh autoftp30.sh in_file &
  230.         ii) run as a foreground job (not recommended) by typing: 
  231.           sh autoftp30.sh in_file 
  232.      where in_file is the name of the input file prepared as above.
  233.  
  234.      If the program is run as a background job (indicated by "&" at the
  235.      end of the line, do a "man sh" for more information), then the 
  236.      terminal on which this command is issued is freed right away. Thus
  237.      the user can immediately issue whatever other commands he may want.
  238.      Otherwise, the terminal is taken by the autoftp process, and the 
  239.      user has to wait until its completion (upto several hours) before 
  240.      he can issue any other command.
  241.  
  242.      While the program is running background, its status can be checked
  243.      by issuing "ps -xg" (do a "man ps" for more information). It can
  244.      be terminated, if the user wishes, by "kill -9 pid" where "pid" is
  245.      the process id, shown by "ps", of the very process to be terminated
  246.      (do a "man kill" for more information.)
  247.  
  248.   3. The results are a number of files: the files received, and 6 working
  249.      files created by the execution. Among the 6 files, 5 of them only
  250.      exist during the execution.
  251.  
  252.      a) XXXXXmsg :-   (XXXXX is a process ID number, as shown by a "ps"
  253.                command in UNIX.)
  254.           This is the only working file that is usually left after the
  255.        execution and the only working file the user should be concerned
  256.        with. It contains the history of the ftp attempts. Check this file
  257.        to see if each requested file is successfully transferred. A file
  258.        transfer fails only when it is too large or has a wrong name,
  259.        which will be reported in this file. (If your local system goes
  260.        down, or the process is killed by a "kill" command, the transfer
  261.        will of course be interrupted and no message will be reported in
  262.        these cases.)
  263.  
  264.      b) XXXXXstdout, XXXXXstderr, XXXXXftp.script, XXXXXtmp :-   
  265.         (XXXXX is again a process ID number, as shown by a "ps"
  266.          command in UNIX.)
  267.           These files are temporary working files. XXXXXtmp only exists
  268.         momentarily. If the autoftp30.sh terminates gracefully, they will
  269.         all be erased upon its completion. Otherwise, the user can always
  270.         delete them manually (this happens if the autoftp30.sh is killed
  271.         by a kill command of UNIX, the local machine went down in the
  272.         middle of the execution, or due to a situation unanticipated by
  273.         the AutoFtp.)
  274.  
  275. ========================================================================
  276.  
  277. History:
  278.  
  279.   Version 2.1 (GET21), by Mingqi Deng, Jan. 12, 1989
  280.   --------------------------------------------------
  281.  
  282.      1. Unlike Get20, Get21 will not give up when connection is refused
  283.         or disrupted. Therefore the users will be relieved from the
  284.         frustration of running it over and over again for a good
  285.         connection.
  286.      2. To get out from a silent connection, there is a time out for 
  287.     each connection. The default is one hour. For large files or 
  288.     slow communication lines, the user is advised to increase the 
  289.     value.
  290.      3. A separate shell program sample is included for transferring
  291.         multiple files from SIMTEL20. 
  292.  
  293. -----------------------------------------------------------------------
  294.  
  295. Version 2.0 (GET20) by  : Ferd Boundick
  296. ---------------------------------------
  297.  
  298.    date written: some time in 1983
  299.    modification: 22 March 84
  300.  
  301.      1. ftp modes are referred to as "ascii, binary, and tenex"
  302.      2. The option -8 is identical to -t for tenex (36->8) transfers.
  303.      3. Remote host name now is stored in the variable "RemoteHost".
  304.      4. Local host name now is stored in the variable "LocalHost" for
  305.       remote login usage.
  306.