home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / unix / ultrix / 6672 < prev    next >
Encoding:
Text File  |  1992-09-03  |  1.2 KB  |  38 lines

  1. Newsgroups: comp.unix.ultrix
  2. Path: sparky!uunet!decwrl!deccrl!news.crl.dec.com!pa.dec.com!decuac!hussar.dco.dec.com!mjr
  3. From: mjr@hussar.dco.dec.com (Marcus J. Ranum)
  4. Subject: Re: FTP batch style ?
  5. Message-ID: <1992Sep3.193748.27591@decuac.dec.com>
  6. Sender: news@decuac.dec.com (USENET News System)
  7. Nntp-Posting-Host: hussar.dco.dec.com
  8. Organization: Digital Equipment Corporation, Washington ULTRIX Resource Center
  9. References: <1992Sep3.120725.1@vax.sonoma.edu>
  10. Date: Thu, 3 Sep 1992 19:37:48 GMT
  11. Lines: 25
  12.  
  13. >  I'm trying to come up with a script file which FTP's an empty file
  14. >to another host (local) which is non-UNIX/ULTRIX.......I'd like to see
  15. >examples of how this is done.....the man pages are somewhat vague about
  16. >how the .netrc is invoked and I would like the script to be cronable
  17.  
  18.     Let's suppose I want to copy a file from my local server, 'urc'
  19.  
  20.     Well, first you put something like this in your .netrc:
  21.  
  22. machine urc login anonymous password mjr@dco.dec.com
  23.  
  24.     Then you write a shell script like:
  25.  
  26. #!/bin/sh
  27. ftp urc << _EOF_
  28. cd pub
  29. prompt
  30. mget *.Z
  31. quit
  32. _EOF_
  33.  
  34.     Then execute the shell script from cron. Doing stuff like trapping
  35. errors and logging it is left as an exercise for the reader.
  36.  
  37. mjr.
  38.