home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / next / sysadmin / 7325 < prev    next >
Encoding:
Internet Message Format  |  1993-01-07  |  2.1 KB

  1. Path: sparky!uunet!zaphod.mps.ohio-state.edu!darwin.sura.net!paladin.american.edu!gatech!swrinde!network.ucsd.edu!hobbes!wade
  2. From: wade@hobbes.ucsd.edu (Wade Blomgren)
  3. Newsgroups: comp.sys.next.sysadmin
  4. Subject: Re: cron and shell scripts
  5. Date: 7 Jan 1993 19:01:48 GMT
  6. Organization: UC San Diego Academic Computing
  7. Lines: 44
  8. Distribution: usa
  9. Message-ID: <1ihumsINN1mq@network.ucsd.edu>
  10. References: <86258@ut-emx.uucp>
  11. NNTP-Posting-Host: hobbes.ucsd.edu
  12. Summary: csh under cron, strange failures
  13.  
  14.  
  15. In an article, mikael@scout.utexas.edu (Mikael Behrens) writes:
  16. |> 
  17. |> [description of failure of cron entry for user other than root]
  18.  
  19. After upgrading to 3.0 I am having a related problem, with non-root
  20. csh scripts run from cron.  The scripts are run, but any redirection
  21. of output from a command in the script goes to the standard output
  22. of the script, not to the target of the redirection.
  23.  
  24. For example, the following script (saved in, say, /tmp/script, mode 755):
  25.  
  26. #! /bin/csh
  27. echo foo > /tmp/bar
  28.  
  29. run by the following crontab entry:
  30.  
  31. * * * * * me /tmp/script > /tmp/script.out 2>&1
  32.  
  33. results in the word "foo" appearing in /tmp/script.out, NOT /tmp/bar.
  34.  
  35. The same is true for piped output:
  36.  
  37. cat /etc/hosts | grep localhost > /tmp/bar
  38.  
  39. will send the entire hosts file to the output of the script, and nothing
  40. goes through the grep or into /tmp/bar.
  41.  
  42. NOTE: the output files _are created_.  That is to say, in the first
  43. simple example, the file /tmp/bar will exist, but it will be empty.
  44.  
  45. This behavior does not seem to happen when the cron command is run by
  46. root.  When the script is run from the command line by the user account
  47. it works fine. 
  48.  
  49. The problem does not occur on a self contained machine in my office but
  50. it does occur on our other machines.  As I type this I realize the main
  51. difference between my machine and the failing machines is the failing
  52. machines are running NIS.  I'm going to turn NIS off on one of the
  53. machines and see if the problem goes away.  In the meantime, can anyone
  54. else who is using NIS (or not) under 3.0 comment?  Am I hallucinating?
  55.  
  56. Wade Blomgren
  57. wade@hobbes.ucsd.edu
  58.