home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / sys / next / sysadmin / 6398 < prev    next >
Encoding:
Text File  |  1992-11-10  |  1.7 KB  |  61 lines

  1. Newsgroups: comp.sys.next.sysadmin
  2. Path: sparky!uunet!caen!zaphod.mps.ohio-state.edu!magnus.acs.ohio-state.edu!shviid
  3. From: shviid@magnus.acs.ohio-state.edu (Steen H Hviid)
  4. Subject: problem using 'dump' from cron
  5. Message-ID: <1992Nov10.161836.22028@magnus.acs.ohio-state.edu>
  6. Sender: news@magnus.acs.ohio-state.edu
  7. Nntp-Posting-Host: top.magnus.acs.ohio-state.edu
  8. Organization: The Ohio State University
  9. Distribution: usa
  10. Date: Tue, 10 Nov 1992 16:18:36 GMT
  11. Lines: 48
  12.  
  13. Hi Everybody,
  14.  
  15. I have a problem, my script works absolutely fine when run interactively, and
  16. even in the background using nohup, but it fails when run by cron (as root).  
  17.  
  18. It tells me that 'dump' terminated with error code 1.
  19.  
  20. Also, I wanted to redirect the output from the dump command into a file, 
  21. which I would have the script mail to me if anything went wrong, but it doesn't
  22. like that either. If I redirect standard output, nothing appears there, if I 
  23. redirect error output, it complains about ambiguos redirection.
  24. I have tried in the crontab entry to redirect the output of the script to both a
  25. file and null with to no avail. 
  26.  
  27. I am new to the NeXT's so I may overlook something obvious.
  28. Any suggestions?
  29.  
  30. Thanks
  31.  
  32. Steen
  33. Computer Speclialist
  34. The Ohio State University
  35.  
  36.  
  37. # NeXT network server backup
  38. # Daily unattended backup
  39. # Steen Hansen, November 1992
  40.  
  41. LASTLOG="/tmp/backup.last"
  42. ERRLOG="/tmp/backup.err"
  43. MAILTO="steen"
  44.  
  45. date > $LASTLOG
  46. dump 0fsd /dev/rst0 2750 640000
  47. code=$?
  48.  
  49. unload tape
  50. mt -t /dev/rst0 off
  51.  
  52. if [ $code != 0 ]
  53. then
  54.    echo "dump returned error code $code" >> $LASTLOG
  55.    mail -s "NeXT network backup failure"  $MAILTO < "$LASTLOG"
  56. else
  57.   echo 'backup completed' | mail -s 'NeXT backup completed' $MAILTO
  58. fi
  59.  
  60.  
  61.