Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.1 6/24/83 (MC840302); site ttds.UUCP
Path: utzoo!watmath!clyde!bonnie!akgua!sdcsvax!sdcrdcf!hplabs!hao!seismo!mcvax!enea!ttds!johanw
From: johanw@ttds.UUCP (Johan Wide'n)
Newsgroups: net.unix-wizards
Subject: Summary: Taking a backup at 5 am (4.2BSD)
Message-ID: <754@ttds.UUCP>
Date: Sat, 15-Dec-84 20:35:03 EST
Article-I.D.: ttds.754
Posted: Sat Dec 15 20:35:03 1984
Date-Received: Wed, 12-Dec-84 05:46:20 EST
Organization: The Royal Inst. of Techn., Stockholm
Lines: 123
A couple of weeks ago I posted an article describing a way to take a single
user mode dump during the wee hours of the night. Here is a summary of the
responses I got.
First to recap:
>We take backups with /etc/dump. It is possible to get a reasonably
>errorfree dump in multi user mode if the system activity is low.
>As our systems can be quite active even at a very odd hour, we prefer
>to take backups in single user mode.
Although we dump directly to tape, a common approach is as follows:
Take the system down into single user mode.
Instead of dumping the disk partition to tape you copy it to another
(unmounted) disk partition.
Take the system up into multi user mode.
During the following day the copy of the partition is dumped to tape
(in multi user mode). As the copy resides on an unmounted partition
there will be no problems with i-nodes being modified during the dump.
This approach has the obvious benefit that the operator is available and can
respond to error messages from dump, change tapes etc.
Per Hedeland (mcvax!enea!erix!per) presented a script for taking the
system down into single user mode, executing a shell script and then returning
to multi user mode again (without a reboot).
This is based on providing a check for the existence of a file in /.profile.
Note that the script is experimental and that there are a few problems:
When you enter single user mode and then reenter multi user mode
/etc/mtab is cleared. This means that
mount -a
will not work. Per suggests that one should put a
umount -a somewhere in the script. Here is his addition to
/.profile. ('exec -mv' is supposed to kill the shell)
========================================================================
# For doing dumps etc in single user and then returning to multi :
# If there is a file /single_shot owned by root and created today,
# source it, remove it, and die
# (Assumes, of course, that root doesn't run /bin/sh in multi-user)
if [ -f /single_shot ]
then
set - `ls -l /single_shot`
owner="$3"
ctime="$5 $6"
set - `date`
if [ "$owner" = root -a "$ctime" = "$2 $3" ]
then
. /single_shot
exec mv -f /single_shot /single_done
else
rm -f /single_shot
fi
fi
export PATH TERM
========================================================================
Here is Per's script for requesting a single user mode dump (in this
case from a Sun to a Vax-disk).
========================================================================
#!/bin/sh
if [ $# -ne 1 ]
then
echo "usage: dump_at 'time'"
exit 1
fi
cat >/single_shot <" /mnt/dump/erix-s/root ; \
/etc/dump 0uf - /dev/rxy0g | \
/usr/ucb/rsh erix cat ">" /mnt/dump/erix-s/usr ) >/dump_log 2>&1
EOF
at $1 <