home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / unix / ultrix / 9046 < prev    next >
Encoding:
Internet Message Format  |  1992-12-22  |  2.0 KB

  1. Xref: sparky comp.unix.ultrix:9046 comp.unix.admin:6756
  2. Path: sparky!uunet!paladin.american.edu!darwin.sura.net!ra!wintermute.phys.psu.edu!leps5.phys.psu.edu!kenh
  3. From: kenh@leps5.phys.psu.edu (Ken Hornstein)
  4. Newsgroups: comp.unix.ultrix,comp.unix.admin
  5. Subject: Re: Backup procedure sought
  6. Date: 22 Dec 1992 21:58:03 GMT
  7. Organization: Penn State, Laboratory for Elementary Particle Science
  8. Lines: 30
  9. Message-ID: <1h831bINNmnk@wintermute.phys.psu.edu>
  10. References: <1992Dec22.145720.1684@dd.dk> <1992Dec22.202405.6087@nntpd2.cxo.dec.com>
  11. Nntp-Posting-Host: leps5.phys.psu.edu
  12. Keywords: Ultrix 4.3 backup dump tape date
  13.  
  14. In article <1992Dec22.202405.6087@nntpd2.cxo.dec.com> alan@nabeth.enet.dec.com (Alan Rollow - Alan's Home for Wayward Tumbleweeds.) writes:
  15. >2.  Clue: When the transition is made from multi-user to single user, init
  16. >    starts an sh(1).  When this sh(1) starts it performs the shell commands
  17. >    in .profile.  It should be possible to replace .profile with a script
  18. >    that unmounts the file system, runs dump and does whatever you want
  19. >    done running single user.  Then you want to replace .profile with the
  20. >    original one and have the shell kill itself.  This should transition
  21. >    backup to multi-user.  I did this once on ULTRIX V1.something when
  22. >    I worked at the CSC.  I didn't save the .profile, but it was pretty
  23. >    easy once I figured out how to have the shell kill itself.  I think
  24. >    I just sent a signal using kill(1) to the process id $$.
  25.  
  26. I do something similar, except I have root's .profile look for a magic cookie;
  27. that way I don't have to replace root's .profile.  Here's an example (which I
  28. admit is not very robust):
  29.  
  30. if [ -f /etc/dobackup ]; then
  31.         echo "Performing automatic system backup"
  32.         cp /usr/adm/backup-level0 /tmp/level0
  33.         /etc/umount -a
  34.         /bin/sync; /bin/sync
  35.         /etc/fsck
  36.         /bin/sh /tmp/level0
  37.         rm -f /etc/dobackup /tmp/level0
  38.         /etc/reboot
  39. fi
  40.  
  41. You could replace the /etc/reboot in the last line with a /bin/kill $$.
  42.  
  43. --Ken
  44.