home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / comp / unix / admin / 4989 < prev    next >
Encoding:
Internet Message Format  |  1992-09-10  |  3.1 KB

  1. Path: sparky!uunet!usc!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!bu.edu!decwrl!pa.dec.com!math.sunysb.edu!scott
  2. From: scott@math.sunysb.edu (Scott Sutherland)
  3. Newsgroups: comp.unix.admin
  4. Subject: multiple machine distribution architecture
  5. Message-ID: <9209101906.AA24571@math.sunysb.edu>
  6. Date: 10 Sep 92 19:06:27 GMT
  7. Lines: 70
  8. X-Received: by usenet.pa.dec.com; id AA17768; Thu, 10 Sep 92 12:06:36 -0700
  9. X-Received: by inet-gw-1.pa.dec.com; id AA01816; Thu, 10 Sep 92 12:06:35 -0700
  10. X-Received: by math.sunysb.edu (4.1/SMI-4.0)id AA24571; Thu, 10 Sep 92 15:06:27 EDT
  11. X-To: leisner.henr801c@xerox.com
  12. X-Cc: amd-workers@acl.lanl.gov, comp.unix.admin.usenet,
  13.  
  14. X-        sunsystem.all_areas@xerox.com
  15. X-In-Reply-To: Marty Leisner 311/? x?'s message of Thu, 10 Sep 1992 09:15:01 PDT <9209101615.AA01679@louvre.wbst147.xerox.com>
  16.  
  17. ml>    Date:     Thu, 10 Sep 1992 09:15:01 PDT
  18. ml>    From: leisner@eso.mc.xerox.com (Marty Leisner 311/? x?)
  19. ml>    Organization: Xerox
  20. ml>    Reply-To: leisner.henr801c@xerox.com
  21. ml>    Sender: <owner-amd-workers@acl.lanl.gov>
  22. ml>    
  23. ml>    
  24. ml>    I'm looking for a good way to put binary versions on a known good
  25. ml>    machine, and then distribute what was updated or is new via cron??
  26. ml>    
  27. ml>    I supposed the best way is to do a make install on packages on the
  28. ml>    primary servers, where the mount point is a link file system (so I'm
  29. ml>    guaranteed to get this file system).  [I'm using amd, I have no idea
  30. ml>    how to do this in automounter]
  31. ml>    
  32. ml>    Then some type of cron script to copy what is new/changed to the
  33. ml>    other redundant machines...
  34. ml>        [ ... ]
  35. ml>       Marty    leisner.henr801c@xerox.com 
  36.  
  37. Yes, this is easily done that way.  A little script that just runs find can
  38. do it  for you.  Something like the following should work for you:
  39.  
  40. #!/bin/sh
  41. targetdir=`pwd`        # probably breaks with amd/automounter; set
  42.             # explicitly and do a cd $targetdir first
  43. timestamp=".timestamp"
  44. targetmachines="host1 host2 host3" #hosts to copy to
  45.  
  46. if [ ! -f $timestamp ]; then
  47.     files=`find . -print`
  48. else
  49.     files=`find . -newer $timestamp -print`
  50. fi
  51. touch $timestamp
  52.  
  53. if [ $files ]; then
  54.     echo updating the following files on $targetmachines:
  55.     ls -l $files
  56.     for host in $targetmachines; do
  57.         echo -n $host " "
  58.         rcp $files $host:$targetdir
  59.         echo "."
  60.     done
  61. fi
  62.  
  63. exit 0
  64.  
  65. Note that I haven't tested this and just wrote it; you should do that first.
  66. Also, there's a little bug in that if a file changes while the find is
  67. running, it may get missed (since timestamp is set AFTER the find finishes).
  68. Also, if the rcp fails for a particular machine, if will be missed next time
  69. around.  And of course you have to be able to rcp to the machines in
  70. question. These can all be worked around if you want, but....
  71.  
  72. Another way to do it us like the above, but use GNU tar to build and pack
  73. the list of files (it has a -newer option too), and then unpack that on each
  74. machine. 
  75.  
  76. Rdist is really designed to do this sort of thing, but as you said, you had
  77. trouble doing it.  There's usually about 10 ways to solve a given problem,
  78. anyway.
  79.  
  80.  
  81.     Scott Sutherland
  82.     scott@math.sunysb.edu
  83.     Stony Brook Institute for Mathematical Sciences
  84.