Automatic unattended execution of 'dump' ?

Per Hedeland per at erix.UUCP
Wed Sep 24 19:17:17 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

>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.

Actually, you will find that the shell does not *exit* when encountering
'exit' in .profile or .cshrc, it merely starts reading from the terminal.
Replacing 'rm -f ...' with 'exec rm -f ...' will have the desired effect.
(This is on 4.2, which ought to be relevant since the question was on Ultrix.)

>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 4.2, dump will ask for the help from /dev/tty (and keep asking forever(?),
hanging the system in single user). If /dev/tty can't be opened, dump just
quits - i.e. running dump from a little program that takes away the 
controlling terminal (via TIOCNOTTY) is a good idea.

We have used essentially this scheme for a long time; it works fine
(although there are a couple of additional minor details to consider).

----
Per Hedeland
{seismo,mcvax}!enea!erix!per  or  per at erix.uucp



More information about the Comp.unix.wizards mailing list