home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 35 Internet / 35-Internet.zip / ncftp19.zip / ncftpget.txt < prev    next >
Text File  |  1999-08-29  |  7KB  |  264 lines

  1.  
  2.  
  3.  
  4. ncftpget(1)                                           ncftpget(1)
  5.  
  6.  
  7. NAME
  8.        ncftpget - Internet file transfer program for scripts
  9.  
  10. SYNOPSIS
  11.        ncftpget  [options]  remote-host  local-directory  remote-
  12.        files...
  13.  
  14.        ncftpget -f login.cfg  [options]  local-directory  remote-
  15.        files...
  16.  
  17.        ncftpget [options] ftp://url.style/host/path/name
  18.  
  19. OPTIONS
  20.    Command line flags:
  21.        -u XX   Use username XX instead of anonymous.
  22.  
  23.        -p XX   Use password XX with the username.
  24.  
  25.        -P XX   Use port number XX instead of the default FTP ser-
  26.                vice port (21).
  27.  
  28.        -d XX   Use the file XX for debug logging.
  29.  
  30.        -a      Use ASCII transfer type instead of binary.
  31.  
  32.        -t XX   Timeout after XX seconds.
  33.  
  34.        -v/-V   Do (do not) use progress meters.  The  default  is
  35.                to  use  progress meters if the output stream is a
  36.                TTY.
  37.  
  38.        -f XX   Read the file XX  for  host,  user,  and  password
  39.                information.
  40.  
  41.        -A      Append  to  local  files,  instead  of overwriting
  42.                them.
  43.  
  44.        -z/-Z   Do (do not) try to resume transfers.  The  default
  45.                is to try to resume (-z).
  46.  
  47.        -F      Use passive (PASV) data connections.
  48.  
  49.        -DD     Delete  remote file after successfully downloading
  50.                it.
  51.  
  52.        -R      Recursive mode; copy whole directory trees.
  53.  
  54.        -r XX   Redial a maximum of XX times  until  connected  to
  55.                the remote FTP server.
  56.  
  57. DESCRIPTION
  58.        The  purpose  of ncftpget is to do file transfers from the
  59.        command-line without entering an interactive shell.   This
  60.        lets you write shell scripts or other unattended processes
  61.  
  62.  
  63.  
  64.                             NCEMRSoft                           1
  65.  
  66.  
  67.  
  68.  
  69.  
  70. ncftpget(1)                                           ncftpget(1)
  71.  
  72.  
  73.        that can do FTP.  It is also useful for advanced users who
  74.        want to retrieve files from the shell command line without
  75.        entering an interactive FTP program such as ncftp.
  76.  
  77.        One particularly useful feature of this  program  is  that
  78.        you  can  give  it  a uniform resource locator as the only
  79.        argument and the program will download that file.  You can
  80.        then  copy  and  paste from your web browser or newsreader
  81.        and use that URL.  Example:
  82.  
  83.            $ cd /tmp
  84.            $ ncftpget ftp://ftp.probe.net/pub/ncftp/ncftp.tar.Z
  85.            $ zcat ncftp.tar.Z | tar xf -
  86.  
  87.        By default the program tries to open the remote  host  and
  88.        login  anonymously,  but  you  can  specify a username and
  89.        password information.  The -u option is  used  to  specify
  90.        the  username  to  login  as, and the -p option is used to
  91.        specify the password.  If you are running the program from
  92.        the shell, you may omit the -p option and the program will
  93.        prompt you for the password.
  94.  
  95.        Using the -u and -p options are not  recommended,  because
  96.        your  account information is exposed to anyone who can see
  97.        your shell script or your process information.  For  exam-
  98.        ple,  someone using the ps program could see your password
  99.        while the program runs.
  100.  
  101.        You may use the -f option instead to specify a  file  with
  102.        the  account  information.   However,  this  is  still not
  103.        secure because anyone who has read access to the  informa-
  104.        tion  file can see the account information.  Nevertheless,
  105.        if you choose to use the -f option the  file  should  look
  106.        something like this:
  107.  
  108.            host Bozo.probe.net
  109.            user gleason
  110.            pass mypasswd
  111.  
  112.        Don't  forget to change the permissions on this file so no
  113.        one else can read them.
  114.  
  115.        The -d option is very useful when you are trying to  diag-
  116.        nose  why  a  file transfer is failing.  It prints out the
  117.        entire FTP conversation to the file you  specify,  so  you
  118.        can  get  an  idea of what went wrong.  If you specify the
  119.        special name stdout as the name of  the  debugging  output
  120.        file,  the output will instead print to the screen.  Exam-
  121.        ple:
  122.  
  123.            $ ncftpget -d stdout ftp.probe.net . /pub/ncftp/README
  124.            220: ftp.probe.net FTP server ready.
  125.            Connected to ftp.probe.net.
  126.            Cmd: USER anonymous
  127.  
  128.  
  129.  
  130.                             NCEMRSoft                           2
  131.  
  132.  
  133.  
  134.  
  135.  
  136. ncftpget(1)                                           ncftpget(1)
  137.  
  138.  
  139.            331: Guest login ok, send your complete e-mail address
  140.            as password.
  141.            Cmd: PASS xxxxxxxx
  142.            230: Welcome!
  143.            Logged in to ftp.probe.net as anonymous.
  144.            Cmd: TYPE I
  145.            200: Type set to I.
  146.            Cmd: SIZE /pub/ncftp/README
  147.            550: /pub/ncftp/README: not a plain file.
  148.            Cmd: MDTM /pub/ncftp/README
  149.            550: /pub/ncftp/README: No such file or directory.
  150.            Cmd: PORT 192,168,1,17,6,76
  151.            200: PORT command successful.
  152.            Cmd: RETR /pub/ncftp/README
  153.            550: /pub/ncftp/README: No such file OR directory.
  154.            ncftpget: file retrieval error: could not  start  data
  155.            transfer.
  156.            Cmd: QUIT
  157.            221: Goodbye.
  158.  
  159.        Using  ASCII  mode is helpful when the text format of your
  160.        host differs from that of the remote host.   For  example,
  161.        if  you  are  retrieving  a .TXT file from a Windows-based
  162.        host to a UNIX system, you could use  the  -a  flag  which
  163.        would  use ASCII transfer mode so that the file created on
  164.        the UNIX system would be in the UNIX text  format  instead
  165.        of the MS-DOS text format.
  166.  
  167.        You  can  retrieve  an  entire  directory tree of files by
  168.        using the -R flag.  However, this will work  only  if  the
  169.        remote  FTP  server  is  a UNIX server, or emulates UNIX's
  170.        list output.  Example:
  171.  
  172.            $ ncftpget -R ftp.probe.net /tmp /pub/ncftp
  173.  
  174.        This would create a /tmp/ncftp hierarchy.
  175.  
  176. DIAGNOSTICS
  177.        ncftpget returns the following exit values:
  178.  
  179.        0       Success.
  180.  
  181.        1       Could not connect to remote host.
  182.  
  183.        2       Could not connect to remote host - timed out.
  184.  
  185.        3       Transfer failed.
  186.  
  187.        4       Transfer failed - timed out.
  188.  
  189.        5       Directory change failed.
  190.  
  191.        6       Directory change failed - timed out.
  192.  
  193.  
  194.  
  195.  
  196.                             NCEMRSoft                           3
  197.  
  198.  
  199.  
  200.  
  201.  
  202. ncftpget(1)                                           ncftpget(1)
  203.  
  204.  
  205.        7       Malformed URL.
  206.  
  207.        8       Usage error.
  208.  
  209.        9       Error in login configuration file.
  210.  
  211.        10      Library initialization failed.
  212.  
  213.        11      Session initialization failed.
  214.  
  215. AUTHOR
  216.        Mike Gleason, NCEMRSoft (mgleason@probe.net).
  217.  
  218. SEE ALSO
  219.        ncftpput(1), ncftp(1), ftp(1), rcp(1), tftp(1).
  220.  
  221.        LibNcFTP (http://www.probe.net/~mgleason/libncftp).
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.  
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.                             NCEMRSoft                           4
  263.  
  264.