TEXT   173
set path sprite cmds
Guest on 7th December 2024 12:50:27 AM


  1. #! /sprite/cmds/csh -fb
  2. #
  3. # This file rdists the entire Sprite file system and is invoked
  4. # nightly by crontab.
  5. #
  6. # $Header:/sprite/admin/RCS/Rdist,v1.3  jhh Exp $
  7.  
  8. set path = (/sprite/cmds)
  9.  
  10. echo -n "Rdist started: "; date
  11. set distfile=(/sprite/admin/distfile)
  12.  
  13. # Address to send error messages to
  14. set admin=jhh
  15.  
  16. set targets=(kernel include)
  17.  
  18. # First make a dry run through to make sure the distfile is
  19. # acceptable.
  20. rdist -n -f $distfile $targets > /dev/null
  21. if ($status != 0) then
  22.     echo "Error in $distfile."
  23.     echo "Error in $distfile." | Mail -s "distfile problem" $admin
  24. else
  25. # The dry run worked.
  26. # Rdist each target individually to get around a bug that is causing
  27. # rdist to die.  Maybe.
  28.     foreach target ($targets)
  29.         echo "rdist $target"
  30.         rdist -f $distfile $target | grep -v "updated" | \
  31.                                      grep -v "Warning: remote mode"
  32.         if ($status != 0) then
  33.             echo "Please check /sprite/admin/Rdist.log." | \
  34.                     Mail -s "rdist of $target failed" $admin
  35.         endif
  36.     end
  37. endif    
  38. echo -n "Rdist completed: "; date

Raw Paste

Login or Register to edit or fork this paste. It's free.