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

  1. Xref: sparky comp.unix.ultrix:9070 comp.unix.admin:6779
  2. Newsgroups: comp.unix.ultrix,comp.unix.admin
  3. Path: sparky!uunet!munnari.oz.au!metro!gtw
  4. From: gtw@arts.su.oz.au (Gilbert Taylor-Wood)
  5. Subject: Re: Backup procedure sought
  6. Message-ID: <root.725171071@plato.arts.su.oz.au>
  7. Keywords: Ultrix 4.3 backup dump tape date
  8. Sender: news@ucc.su.OZ.AU
  9. Nntp-Posting-Host: plato.arts.su.oz.au
  10. Organization: Sydney University Computing Service, Sydney, NSW, Australia
  11. References: <1992Dec22.145720.1684@dd.dk>
  12. Date: Thu, 24 Dec 1992 04:24:31 GMT
  13. Lines: 155
  14.  
  15. wes@dd.dk (Mads Westermann) writes:
  16.  
  17. >I need a backup procedure that (unattended) will bring the system
  18. >into single-user mode, do a full or an incremental backup on *ONE* tape
  19. >and then bring the system back into multi-user mode again. 
  20.  
  21. >Has anybody solved this problem ?? I'd very much appreciate if you
  22. >could enlighten me on this subject.
  23.  
  24. Here is my solution. If anyone can improve on it I would like to know.
  25.  
  26. Happy Christmas
  27.  
  28.   Gilbert
  29.  
  30. Gilbert Taylor-Wood                          gtw@arts.su.edu.AU
  31. Network Manager
  32. Faculty of Arts A14                          Ph  +61 2 692 4713
  33. The University of Sydney                     Fax +61 2 692 2045
  34. NSW 2006
  35. AUSTRALIA                    SysAdmin: The ghost in the machine
  36.  
  37.  
  38. ***
  39. *** Put an entry in /etc/crontab to start this off.
  40. ***
  41.  
  42. 0 1 * * 2,3,4,5,6 usr/bin/touch /tmp/DO_DUMP; shutdown -r 04:00 'System Backup'
  43.  
  44. ***
  45. *** Modify /etc/rc to include the following
  46. ***
  47.  
  48. [deleted stuff ]
  49.     export DISKLESS
  50. }
  51.  
  52. if test -f /tmp/DO_DUMP
  53. then 
  54.         DO_DUMP=true
  55.         FSCK_OPTS=-n
  56.         rm -f /tmp/DO_DUMP
  57. else
  58.         FSCK_OPTS=-p
  59. fi
  60.  
  61. /etc/startcpu     >/dev/console
  62.  
  63. date >/dev/console
  64. if [ $1x = autobootx ]
  65. then
  66.     echo Automatic reboot in progress... >/dev/console
  67.     /etc/fsck $FSCK_OPTS >/dev/console
  68.     case $? in
  69.     0)
  70.          ;;
  71. [stuff deleted]
  72. fi
  73. #
  74. # After successful fsck do backup if necessary
  75. if test $DO_DUMP = true
  76. then
  77.     /bin/sh /etc/full_dump
  78.     if test $? -ne 0 
  79.     then
  80.         DUMP_STATUS=FAILED
  81.     else
  82.         DUMP_STATUS=succssfull
  83.     fi
  84. fi
  85.  
  86. [More deleted stuff that brings the system up to Multi-User ]
  87.  
  88. sh /etc/rc.local 
  89.                 echo 'preserving editor files'     >/dev/console
  90. (cd /tmp; /usr/lib/ex3.7preserve -a)
  91. #
  92. # Mail results of Dump to root
  93. #
  94. if test $DO_DUMP = true
  95. then
  96.     cat /tmp/full_dump.LOG | /usr/ucb/mail -u daemon \
  97.         -s "$DUMP_STATUS dump of Plato" root
  98. fi
  99.                 echo clearing /tmp        >/dev/console
  100. (cd /tmp; rm -f *; chmod 1777 /tmp)
  101.  
  102. [finish off.... ]
  103.  
  104. ***
  105. *** /etc/full_dump looks like
  106. ***
  107.  
  108.  
  109. #!/bin/sh
  110. #
  111. # This script is tailored for plato
  112. #
  113. cd /etc
  114. USER=daemon
  115. NICE=-15
  116. # On plato(two drives) /dev/nrmt1? is scsi tz (DAT) drive
  117. OUTDEV=/dev/nrmt1h
  118. FLAG=
  119. #LENGTH for tz SCSI tape drive(WangDat) is 60m(90Min)/90m(120min) (60m=195ft)
  120. #DENSITY for tz SCSI tape drive(WangDat) is 61000bpi Uncompressed (90m=292ft)
  121. # Fake the length to get the calculations to work.
  122. LENGTH=1818
  123. DENSITY=61000
  124. STATUS=good
  125. DONE=
  126. PROG=`basename $0`
  127. LOG=/tmp/${PROG}.LOG
  128. LIST="root users local usr var aufs0 aufs1 "
  129. for NAME in $LIST
  130. do
  131.     case $NAME in
  132.         root|/)        DRIVE=rz3a
  133.         usr|/usr)    DRIVE=rz3d
  134.         local|/local)    DRIVE=rz3e
  135.         users|/u0)    DRIVE=rz3f
  136.         aufs1)        DRIVE=rz3g
  137.         aufs0)        DRIVE=rz2d
  138.         var)        DRIVE=rz2a
  139.         *)        echo $PROG: unrecognised filesystem
  140.     esac
  141.     KEY=0
  142.         TYPE=full
  143.  
  144.     echo "File System $NAME $TYPE dump" > /dev/colsole
  145.     echo "File System $NAME $TYPE dump" >> $LOG
  146.     /etc/dump "$KEY"ufsd"$FLAG" $OUTDEV $LENGTH $DENSITY \
  147.         /dev/r"$DRIVE" >> $LOG 2>&1
  148.  
  149. # exit status of dump is 1 for success on ultrix !
  150.     if test $? = 1
  151.     then
  152.         DONE=$DONE" $DRIVE"
  153.     else
  154.         STATUS=bad
  155.     fi
  156. done
  157. if test $STATUS = bad 
  158. then
  159.     exit 1
  160. fi
  161. mt -f $OUTDEV rewind    # was offline
  162. exit 0
  163. --
  164. Gilbert Taylor-Wood                          gtw@arts.su.edu.AU
  165. Network Manager
  166. Faculty of Arts A14                          Ph  +61 2 692 4713
  167. The University of Sydney                     Fax +61 2 692 2045
  168. NSW 2006
  169. AUSTRALIA                    SysAdmin: The ghost in the machine
  170.