Path: utzoo!attcan!utgpu!news-server.csri.toronto.edu!clyde.concordia.ca!uunet!fciva!dag From: dag@fciva.FRANKLIN.COM (Daniel A. Graifer) Newsgroups: comp.unix.admin Subject: Re: Looking for shell script for backup on BSD 4.3 Message-ID: <547@fciva.FRANKLIN.COM> Date: 13 Oct 90 21:08:38 GMT References: <11885@bsu-cs.bsu.edu> <1990Oct12.214824.5890@ucselx.sdsu.edu> Reply-To: dag@fciva.UUCP (Daniel A. Graifer) Organization: Franklin Capital Investments, Inc. McLean, Va. Lines: 43 I have written a sequence of scripts we use here to get the system into an assured idle state for unattended backup. These depend on init state 4 being available for local site use (We are running Prime Computer's port of AT&T SYSV 3.1.2). The sequence of events is as follows: /etc/bupstart runs out of crontab at 6:00am checks for presence of tape in Excebyte drive, and that tape appears different from last backup tape written (In case you forget to change the tape!) broadcasts a warning message writes backup paramenters ( complete/incremental, device, logfilename, filesystemnames ) to /etc/ustate4.rc does a telinit 4 init looks in inittab to get instructions for changing to state 4. entry for /etc/rc0 now has a 4, so system services are shut down. (This is the same as doing a telint 0 or 1 or S) new script /etc/rc4, similar to rc2, runs scripts in /etc/rc4.d remount file systems read /etc/ustate4.rc and start /etc/autobackup autobackup does the backup (we use /etc/savecpio) and moves ustate4.rc to /etc/backup.done do an init 2 respawn a getty on the console so a failure of the init 2 will not leave the system irretrievably hung. init looks in inittab for instructions on returning to multiuser state. new script S99autotapelog in rc2.d looks for /etc/backup.done, and if it is there, does spawns off /etc/autotapelog This does a cpio -ivtB <$DEVICE >$LOGFILE to verify the readability of the tape. Removes /etc/backup.done This should give you enough clues to write your own, or send me email and I will mail you mine. Dan --- Coastal Capital Funding Corp 7900 Westpark Drive, Suite A130 (703)821-3244 McLean, VA 22102 uunet!fciva!dag -- Daniel A. Graifer Franklin Mortgage Capital Corporation uunet!dag@fmccva.franklin.com 7900 Westpark Drive, Suite A130 (703)448-3300 McLean, VA 22102