Hi,
Yesterday, in my email on this subject, I mentioned that
>
> John D Schneider did send me a pair of (sh) scripts that he uses to
> copy the important (modified) files to a remote system before doing
> system upgrades. I (vaguely) remember that those scripts were recently
> mailed by someone to this list. Therefore, I am not including those
> scripts here. If someone wants them, I can mail them to you.
>
By this morning, I received 12 requests asking for a copy of above
scripts. Therefore, I am sending those scripts to this mailing
list. I hope everyone who needs, will have copy of these useful
scripts. ==>> Thanks to John D Schneider <<==
-Mahesh
==================================================
From: jdschn@nicsn1.monsanto.com (John D Schneider)
Subject: Re: OS upgrade 4.0.3 -> 4.1.2
To: mkgarg@shakti.cis.uoguelph.ca (Mahesh Garg)
Date: Mon, 23 Mar 92 10:51:07 CST
Here is a pair of scripts that I use to back up the important (modified)
files when I do system upgrades. It assumes that the backup disk (an NFS disk
in our case) is mounted as /mnt.
/usr/local/bin/sunosbackup:
___________________________________cut here_________________________________
#! /bin/sh -x
# script to backup to a server (usually crygtw) all the important
# files that will need to be reinstated after an upgrade to SUN OS 4.1.1.
# built by John D. Schneider 04/16/91
# History:
# 05/04/91 JDS Added name server config files
mkdir /mnt/etc
mkdir /mnt/var
mkdir /mnt/usr
mkdir /mnt/usr/etc
mkdir /mnt/usr/spool
mkdir /mnt/usr/spool/cron
mkdir /mnt/usr/local
mkdir /mnt/sys
mkdir /mnt/sys/conf
cp -rp /etc/perm* /mnt/etc
cp -rp /etc/volnm.dat /mnt/etc
cp -rp /etc/rc* /mnt/etc
cp -rp /etc/remote /mnt/etc
cp -rp /etc/sendmail* /mnt/etc
cp -rp /etc/shells /mnt/etc
cp -rp /etc/netmasks /mnt/etc
cp -rp /etc/ethers /mnt/etc
cp -rp /etc/netgroup /mnt/etc
cp -rp /etc/exports /mnt/etc
cp -rp /etc/maillist* /mnt/etc
cp -rp /etc/aliases /mnt/etc
cp -rp /etc/auto* /mnt/etc
cp -rp /etc/group /mnt/etc
cp -rp /etc/passwd /mnt/etc
cp -rp /etc/services /mnt/etc
cp -rp /etc/admin* /mnt/etc
cp -rp /etc/fstab /mnt/etc
cp -rp /etc/format.dat /mnt/etc
cp -rp /etc/hosts /mnt/etc
cp -rp /etc/hosts.equiv /mnt/etc
cp -rp /etc/termcap /mnt/etc
cp -rp /sysinfo /mnt
cp -rp /usr/spool/cron/.proto /mnt/usr/spool/cron
cp -rp /sys/conf/NODENAME /mnt/sys/conf
cp -rp /.cshrc /mnt
cp -rp /.defaults /mnt
cp -rp /.exrc /mnt
cp -rp /.login /mnt
cp -rp /.permissions /mnt
cp -rp /.profile /mnt
cp -rp /.rhosts /mnt
cp -rp /.rootmenu /mnt
cp -rp /.suntools /mnt
cp -rp /etc/resolv.conf /mnt/etc
cp -rp /usr/etc/savefs /mnt/usr/etc # NSR program files
cp -rp /usr/etc/recover /mnt/usr/etc
find /usr/local -fstype 4.2 -xdev -print | cpio -paduvm /mnt
find /usr/cops -fstype 4.2 -xdev -print | cpio -paduvm /mnt
find /usr/var -fstype 4.2 -xdev -print | cpio -paduvm /mnt
if [ -f /etc/namedb ] # name server files
then
mkdir /mnt/etc/namedb
cd /etc/namedb
find . -fstype 4.2 -xdev -print | cpio -paduvm /mnt/etc/namedb
cp -rp /etc/inetd.conf /mnt/etc
cp -rp /etc/named.boot /mnt/etc
fi
cd
exit
___________________________________cut here_________________________________
and /usr/local/bin/sunosrestore:
___________________________________cut here_________________________________
#! /bin/sh -x
# script to restore important files backed up by 'sunosbackup' to a server
# These files are to be backed up by 'sunosbackup' prior to a SUN OS upgrade
# and then restored using this script.
# built by John D. Schneider 04/16/91
cp -rp /mnt/etc/perm* /etc #restore SUNLINK config files
cp -p /etc/volnm.dat /etc/volnm.dat.org
cp -rp /mnt/etc/volnm.dat /etc
cp -p /etc/rc /etc/rc.org # restore local rc files
cp -p /etc/rc.boot /etc/rc.boot.org
cp -p /etc/rc.local /etc/rc.local.org
cp -p /mnt/etc/rc /etc
cp -p /mnt/etc/rc.boot /etc
cp -p /mnt/etc/rc.local /etc
cp -p /etc/remote /etc/remote.org # restore /etc/remote
cp -p /mnt/etc/remote /etc
if [ -f /mnt/etc/sendmail.cf ]
then
cp -p /etc/sendmail.cf /etc/sendmail.cf.org # restore /etc/sendmail.cf
cp -rp /mnt/etc/sendmail* /etc
fi
cp -p /mnt/etc/shells /etc
cp -p /etc/netmasks /etc/netmasks.org # restore /etc/netmasks
cp -p /mnt/etc/netmasks /etc
cp -p /mnt/etc/ethers /etc # restore /etc/ethers
cp -p /mnt/etc/netgroup /etc # restore /etc/netgroup
cp -p /etc/exports /etc/exports.org # restore /etc/exports
cp -p /mnt/etc/exports /etc
cp -rp /mnt/etc/maillist* /etc # restore any maillists
cp -p /etc/aliases /etc/aliases.org # restore /etc/aliases
cp -p /mnt/etc/aliases /etc
cp -rp /mnt/etc/auto* /etc
cp -p /etc/group /etc/group.org # restore /etc/group file
cp -p /mnt/etc/group /etc
cp -p /etc/passwd /etc/passwd.org # restore /etc/passwd file
cp -p /mnt/etc/passwd /etc
cp -rp /mnt/etc/admin* /etc # restore all /etc/admin* files
cp -p /etc/fstab /etc/fstab.org # restore /etc/fstab
cp -p /mnt/etc/fstab /etc
cp -p /etc/format.dat /etc/format.dat.org # restore /etc/format.dat
cp -p /mnt/etc/format.dat /etc
cp -p /etc/hosts /etc/hosts.org # restore /etc/hosts
cp -p /mnt/etc/hosts /etc
cp -p /etc/termcap /etc/termcap.org # restore /etc/termcap
cp -p /mnt/etc/termcap /etc
cp -p /mnt/sysinfo / # restore /sysinfo
cp -p /mnt/.cshrc / # restore root's customizations
cp -p /mnt/.defaults /
cp -p /mnt/.exrc /
cp -p /mnt/.login /
cp -p /mnt/.permissions /
cp -p /mnt/.profile /
cp -p /mnt/.rhosts /
cp -p /mnt/.rootmenu /
cp -p /mnt/.suntools /
cp -p /mnt/etc/resolv.conf /etc
cp -p /mnt/usr/etc/savefs /usr/etc # restore NSR files
cp -p /mnt/usr/etc/recover /usr/etc
mkdir /usr/spool # restore /cron/.proto
mkdir /usr/spool/cron
mkdir /usr/var/spool/mail
cp -p /usr/spool/cron/.proto /usr/spool/cron/.proto.org
cp -p /mnt/usr/spool/cron/.proto /usr/spool/cron
mkdir /usr/local # restore /usr/local
cd /mnt/usr/local
find . -print | cpio -paduvm /usr/local
mkdir /usr/cops # restore /usr/cops
cd /mnt/usr/cops
find . -print | cpio -paduvm /usr/cops
mkdir /var # restore /var
cd /mnt/var
find . -print |cpio -paduvm /var
if [ -d /mnt/etc/namedb ] # restore name server files
then
mkdir /etc/namedb
cd /mnt/etc/namedb
find . -print | cpio -paduvm /etc
cp -p /mnt/etc/inetd.conf /etc
cp -p /mnt/etc/named.boot /etc
fi
cd
exit
___________________________________cut here_________________________________
Please look these over carefully, since many of the things may be specific
for our site, and not applicable to yours. It should be a good general
guideline, though.
Please e-mail or call if you have questions.
John Schneider
*******************************************************************************
* John D. Schneider Internet: jdschn@nicsn1.monsanto.com *
* Research Computing Consortium Telephone: (314)537-6808 *
* Monsanto Company - Mail Zone GG3I _________________________________________*
* 700 Chesterfield Parkway North | "Most people's objection to the Bible *
* St. Louis, Missouri 63198 | is not that it contradicts itself, but *
* | that it contradicts them." *
*******************************************************************************
This archive was generated by hypermail 2.1.2 : Fri Sep 28 2001 - 23:06:39 CDT