Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!seismo!mcvax!enea!erix!per From: per@erix.UUCP (Per Hedeland) Newsgroups: net.unix,net.unix-wizards Subject: Re: Automatic unattended execution of 'dump' ? Message-ID: <1167@erix.UUCP> Date: Wed, 24-Sep-86 05:17:17 EDT Article-I.D.: erix.1167 Posted: Wed Sep 24 05:17:17 1986 Date-Received: Fri, 26-Sep-86 01:14:32 EDT References: <128@morgoth.UUCP> <3528@umcp-cs.UUCP> Reply-To: per@erix.UUCP (Per Hedeland) Organization: L M Ericsson, Stockholm, Sweden Lines: 39 Xref: mnetor net.unix:5647 net.unix-wizards:7992 In article <3528@umcp-cs.UUCP> chris@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@erix.uucp