home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #16 / NN_1992_16.iso / spool / comp / unix / shell / 3214 < prev    next >
Encoding:
Text File  |  1992-07-30  |  2.4 KB  |  60 lines

  1. Newsgroups: comp.unix.shell
  2. Path: sparky!uunet!sun-barr!ames!agate!boulder!khonshu!ejh
  3. From: ejh@khonshu.colorado.edu (Edward J. Hartnett)
  4. Subject: dump script rewinds tape - why?
  5. Message-ID: <1992Jul30.184702.7838@colorado.edu>
  6. Summary: I don't want this to rewind the tape after it's done
  7. Sender: news@colorado.edu (The Daily Planet)
  8. Nntp-Posting-Host: khonshu.colorado.edu
  9. Organization: Cooperative Institute for Research in the Environmental Sciences
  10. Date: Thu, 30 Jul 1992 18:47:02 GMT
  11. Lines: 47
  12.  
  13. This is my incremental dump. I would like to have a week's incremental
  14. dumps on one tape, which I can then leave in there all week. Right now
  15. it rewrites over the backup of the day before (i.e. it rewinds the tape
  16. after backups). But why?
  17.  
  18.     Ed Hartnett
  19.     ejh@khonshu.colorado.edu
  20.  
  21. #!/bin/sh
  22. # narrow PATH to trusted dirs
  23. PATH=/usr/ucb:/usr/bin:/usr/etc
  24. # prevent logins during dump
  25. cp /usr/local/etc/nologin /etc/nologin
  26. # will need this later when turning net back on
  27. # warn the unlucky folks already logged in
  28. /usr/bin/wall <<FOOBAR
  29. Incremental dumps will begin in about 5 minutes.  If you are accessing a file
  30. at the same time as dump, that file could be scrogged on the backup, possibly
  31. in your directory on disk, and it is possible that the entire dump could be
  32. scrogged.  Performance will be lousy anyway, so either log out or wait 
  33. patiently for about ten to fifteen minutes or so without typing commands.
  34. If you are remotely logged in, the net connection will be disabled during
  35. the dump which should log you off anyway.   -The Management
  36.  
  37. PS - You're really working too late anyway. Why don't you get a little rest.
  38. This isn't brain surgery, you know, it can probably wait!
  39. FOOBAR
  40. # give them their 300 seconds
  41. /usr/bin/sleep 300
  42. HOSTNAME=`/usr/bin/hostname` export HOSTNAME
  43. # turn net off to prevent incoming mail, rlogins, rshs, and anything else
  44. # that might disturb the dump
  45. ifconfig le0 down
  46. # rm -fr /tmp/*
  47. /usr/etc/dump 5ubdsf 100 6000 54000 /dev/nrst0 /dev/rsd0a
  48. /usr/etc/dump 5ubdsf 100 6000 54000 /dev/nrst0 /dev/rsd0g
  49. /usr/etc/dump 5ubdsf 100 6000 54000 /dev/nrst0 /dev/rsd0h
  50. # this ensures the tape can't be accidentally overwritten before it is removed
  51. #/usr/bin/mt -f /dev/rst0 offline
  52. # re-enable logins
  53. rm /etc/nologin
  54. # resume connection with the net
  55. ifconfig le0 $HOSTNAME netmask 0xffffff00 broadcast 128.138.0.0 -trailers up
  56. /usr/bin/wall <<RABOOF
  57. The incremental dumps are now complete.  You may resume your work.  Thank you
  58. for your cooperation.   -The Management
  59. RABOOF
  60.