Automatic unattended execution of 'dump' ?

Will Edgington/Ejeo wedgingt at udenva.UUCP
Thu Sep 25 02:52:11 AEST 1986


In article <3528 at umcp-cs.UUCP> chris at umcp-cs.UUCP (Chris Torek) writes:
>If your root shell is /bin/sh, you could then put this in /.profile:
>
>	PATH=/bin:/etc; export PATH
>	if [ -f /etc/autodump ]; then
>		sh /etc/autodump
>		rm -f /etc/autodump
>		exit 0
>	fi
>	# rest of /.profile
>
>For /bin/csh, use
>
>	set path = (/bin /etc)
>	if (-f /etc/autodump) then
>		sh /etc/autodump
>		rm -f /etc/autodump
>		exit 0
>	endif
>	# rest of /.cshrc

  Both the 'exit 0's above want to be 'kill $$'s instead.  Exit called
in either a .profile, a .cshrc, or a .login will merely exit the file
and continue the regular interactive shell, waiting for input from the
terminal (in this case, the console).  I use this 'feature' of exit in
my .cshrc and .login to avoid running them if I answer 'no' to a prompt
my .cshrc gives.
  We do dumps 'auotmatically' by telling our operators to pick a certain
choice on their menu (they log in as UID 0, but into a *very* restricted
shell), which runs shutdown after echoing 'backup' into a certain file.
Then, in /.profile, we have a test of the contents of that file; if it
is 'backup', it runs a shell script '/etc/local/backup' which tells the
operators which tape(s) to mount before it starts /etc/dump, the output
of which is redirected using tee to both the console and /tmp/dump.out
(or some such).  /bin/awk is then used to see if the dump failed by
checking for 'DUMP IS DONE' in /tmp/dump.out.  If it failed, it's redone
via a goto in /etc/local/backup; if not, the awk script enters a line in
/etc/local/dump.inv(entory) listing the file system, mount point, number
of tapes required, the date from /etc/dumpdates (or where ever /etc/dump
puts it), the label(s) put on the outside of the tape, etc.  After the
dumps are done, /etc/local/backup exits, returning control to /.profile.
If it exited 0, /.profile assumes the dump(s) worked and does a 'kill -9 $$'
(which is probably excessive, but you don't want it to fail ...).  If
/etc/local/backup exits other than 0, /.profile echos 'Backup failed; leave
machine down and call so and so at 8am.' to the console.  Thus, the operators
know exactly what to do at every step and *they never see Unix directly*, so
we don't have to train them in it.
  I am about to totally rewrite our /etc/local/backup to be more generic about
which disks are backed up and how often, whether or not it's over the ether-
net using rdump, etc., or I would post it.  Anyone who wants any of the
programs described above should send me mail; if I get enough requests, I'll
post everything when I get it in decent shape.  Note that it is (and will be)
only dependent on /etc/dump in a very small section of /etc/local/backup; if
you System V people want to use it with cpio(1) or tar(1), it should be
fairly easy.
-- 
------------------------------------------------------------------------
|"Input!"|"Number 5 is Alive!!"|"Beautiful software"|"Not disassemble!!"
------------------------------------------------------------------------
Will Edgington|Computing and Information Resources, University of Denver
(303) 871-2081|BusAd 469, 2020 S. Race, Denver CO 80208 (work)|"Input!!"
(303) 759-9071|5001 E. Iliff, Denver CO 80222 (home)|"Where's Input?!!?"
{{hplabs,seismo}!hao,ucbvax!nbires,boulder,cires,cisden}!udenva!wedgingt
COMING SOON: wedgingt at eos.cair.du.edu, wedgingt at eos.BITNET ( == udenva )



More information about the Comp.unix.wizards mailing list