Automatic unattended execution of 'dump' ?

Chris Torek chris at umcp-cs.UUCP
Mon Sep 22 08:56:13 AEST 1986


In article <128 at morgoth.UUCP> glidden at morgoth.UUCP (Ken A. Glidden) writes:
>  We have a uVAX II running Ultrix 1.2.  I'd like very much to use
>the crontab to start up a shell script late at night to perform 
>a dump.   Specifically I'd like the shell script to "simulate"
>single user mode by preventing any logins, killing any processes which
>have the potential to alter the disk during the dump, and preventing 
>any processes which may alter the disk during the dump from starting
>while the dump is in progress.  Once finish the script should undo all
>its protections and allow business as usual.

Unfortunately, just about every process might alter the disk.  About
the only way to do this would be to kill everything, then start only
trusted processes.  Indeed, the easiest way to do this would be to
run shutdown.

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

You can then have cron copy a script to /etc/autodump and run
shutdown.  When the machine goes to single user mode, the shell
will read .profile or .cshrc and run autodump, then remove the
script and exit, bringing the machine back up in multi-user mode.

This, like all unattended dump schemes, can run into one problem:
Dumps do not always succeed.  If the dump fails, dump will attempt
to get help; this too will fail, and I am not certain just what
will happen after that.  It should be easy enough to find out: just
leave the tape drive off line and force a run.
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 1516)
UUCP:	seismo!umcp-cs!chris
CSNet:	chris at umcp-cs		ARPA:	chris at mimsy.umd.edu



More information about the Comp.unix.wizards mailing list