[comp.unix.aix] system backups

u714092@eagle.larc.nasa.gov (prichard devon ) (05/14/91)

I have borrowed an 8mm Exabyte with which to do a backup of my system.
question is, it looks like "backup" only does one filesystem at a time,
and every time backup runs, it will overwrite the tape.  I want
to backup all data in rootvg, which has several file systems. 

seeing as this is a short-term opportunity to get a complete system backup,
I'd like to get an exact bit-for-bit copy.  from the documentation ;)
I understand that backup is better than tar for this situation.

so, could anyone tell me how to get a full system backup on one tape?

TIA

--
 ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 | Devon Prichard                "The atrocious crime of being a young  |
 | u714092@eagle.larc.nasa.gov,   man... I shall neither attempt to     |
 | prichard@ias.larc.nasa.gov     palliate nor deny."                   |
 |                                William Pitt, House of Commons, 1741  |
 ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||

rel@mtu.edu (Robert E. Landsparger) (05/14/91)

In article <U714092.91May13155851@eagle.larc.nasa.gov>, u714092@eagle.larc.nasa.gov (prichard devon ) writes:
|> 
|> I have borrowed an 8mm Exabyte with which to do a backup of my system.
|> question is, it looks like "backup" only does one filesystem at a time,
|> and every time backup runs, it will overwrite the tape.  I want
|> to backup all data in rootvg, which has several file systems. 
|> 
|> seeing as this is a short-term opportunity to get a complete system backup,
|> I'd like to get an exact bit-for-bit copy.  from the documentation ;)
|> I understand that backup is better than tar for this situation.
|> 
|> so, could anyone tell me how to get a full system backup on one tape?

If you know how to do each individual file system, then just use the
device /dev/rmt*.1 and this will cuase the tape NOT to rewind when
done with the tape access.  ( see:  man 5 rmt )  On the last file system,
use the device /dev/rmt*.0 to rewind when done.  This will allow you to
put your different file systems in different backup files.

--method 2--

Unmount all the stuff you do not want to place in the back-up file (NFS mounts,
CD rom, and unwanted vgroups, ...) and do the following (as root):

cd /
find . -print | backup -ivp -f /dev/rmt*

This will cause everything to be placed in one file.  Not real bad, if you want
a file, just get it out of this backup file.  The nice thing about this is
that the save path is relative (not absolute).

Hope this helps, and if any one flames me about this carbon it to above if
it is a correction/improvement.  :-)

bob

-- 

USER:		Can I get a list of *all* the unix commands?
CONSULTANT:	man -k - | lpr -                  (* not under AIX, even 3.1.5 *)
USER:		huh?

+-------------------------------------------------------------------------+
| Robert E. Landsparger (rel@mtu.edu) - Computing Technology Services
| Michigan Technological University, Houghton, MI 49931	(906) 487-2110
+--------------------------------------------------------------------+
| The above comments do not always represent those of my employer.
+

tli@Morgan.COM (Thomas Y. Li ) (05/14/91)

In article <U714092.91May13155851@eagle.larc.nasa.gov> u714092@eagle.larc.nasa.gov (prichard devon ) writes:

To backup multiple filesystems on one tape without rewinding use rmt0.1

>so, could anyone tell me how to get a full system backup on one tape?

To get a image of your system, try mkszfile then mksysb. With smit enter
'smit backup'. Note that this method will backup only / /usr and /u.

shah@cdsun.fnal.gov (Hemant Shah) (05/15/91)

In article <U714092.91May13155851@eagle.larc.nasa.gov> u714092@eagle.larc.nasa.gov (prichard devon ) writes:
>
>I have borrowed an 8mm Exabyte with which to do a backup of my system.
>question is, it looks like "backup" only does one filesystem at a time,
>and every time backup runs, it will overwrite the tape.  I want
>to backup all data in rootvg, which has several file systems. 
>
>seeing as this is a short-term opportunity to get a complete system backup,
>I'd like to get an exact bit-for-bit copy.  from the documentation ;)
>I understand that backup is better than tar for this situation.
>
>so, could anyone tell me how to get a full system backup on one tape?
>
>TIA
>
>--

I use Exabyte tape drive to backup my system.

 use followint options :

	backup -0uf /dev/rmt0.1 /
	backup -0uf /dev/rmt0.1 /u
	backup -0uf /dev/rmt0.1 /usr

 and so on for each file system. rmt0.1 means no rewind.


Hemant Shah
Fermilab
System Integration group

E-mail : shah@cdsun5.fnal.gov

Voice  : (708) 840-8071

sanders@sanders.austin.ibm.com (Tony Sanders) (05/16/91)

rel@mtu.edu (Robert E. Landsparger) writes:
>Unmount all the stuff you do not want to place in the back-up file (NFS mounts,
>CD rom, and unwanted vgroups, ...) and do the following (as root):
> 
>cd /
>find . -print | backup -ivp -f /dev/rmt*
> 
>This will cause everything to be placed in one file.  Not real bad, if you want
>a file, just get it out of this backup file.  The nice thing about this is
>that the save path is relative (not absolute).

In ksh I use this function (with my scripts include below):
    # ff - fast find
    function ff { grep -- "$*" /usr/dumps/catalog/full.daily ; }

If you don't want people to read the full.daily file then protect
the catalog directory.

You could use the "p" flag to compress the data if you need to.
Also, -C1024 seems to speed things up a little.

I run it from cron:
    15 2 * * 2,4,6 ( /usr/dumps/full 2>&1 |
                     mail -s "Output from backup: `date`" backups )

I also have cron setup to mail me a notice on monday mornings to change
the tape.

Here are the scripts I wrote for system backups to 8mm tape, incr hasn't
been tested very much.  These also include a list of errors (from errpt)
that occured during the backup.

------------------- /usr/dumps/ shar ----------------------
#!/bin/sh
#    This is a shell archive.
#    Run the following text with /bin/sh to extract.

echo x ./.dumpdates
mkdir ./.dumpdates
echo x ./catalog
mkdir ./catalog
echo x ./config
sed -e 's/^X//' << \EOFMARK > ./config
X# new style config file for rios
X# from ( full incr ) ". ./config"
X# this file sets up the /usr/dumps directory and the tape params
X
X# not used
Xparams="-s24000 -d10240"
Xroot=/usr/dumps/root
X
Xcat=/usr/dumps/catalog
Xdd=/usr/dumps/.dumpdates
Xtape=/dev/rmt0
Xfilelist="./ ./usr ./u ./home"
EOFMARK
echo x ./full
sed -e 's/^X//' << \EOFMARK > ./full
X#!/bin/sh
Xcd /usr/dumps
X. ./config
Xname="`basename $0`"
Xif [ "${name}" = "full" ]; then
X    findargs="-xdev"
Xelse
X    findargs="-newer ${dd}/full -xdev"
Xfi
Xtempfile=${cat}/${name}.0.$$
Xtouch ${dd}/.${name}
Xtrap 'rm -f ${tempfile}; exit 1' 1 2 3 15
X
Xerrpt > /tmp/full.$$
X
Xcd /
X(
X    for i in ${filelist}; do
X	find $i ${findargs} -print
X    done
X) | tee ${tempfile} | /etc/backup -q -if${tape}
Xrc="$?"
Xif [ "$rc" = "0" ]; then
X    mv ${dd}/.${name} ${dd}/${name}
X    # seq="`cat ${cat}/.seq.${name}`"
X    # mv ${tempfile} ${cat}/${name}.$seq
X    # seq="`expr $seq + 1`"
X    # echo $seq > ${cat}/.seq.${name}
X    mv ${tempfile} ${cat}/${name}.daily
Xelse
X    echo "problem with backup?"
Xfi
X
Xecho "\nerror report difference list for the period of the backup:"
Xerrpt | diff /tmp/full.$$ -
Xrm -f /tmp/full.$$
X
Xexit "$rc"
EOFMARK
chmod 755 ./full
echo x ./incr
sed -e 's/^X//' << \EOFMARK > ./incr
X#!/bin/sh
Xcd /usr/dumps
X. ./config
Xname="`basename $0`"
Xif [ "${name}" = "full" ]; then
X    findargs="-xdev"
Xelse
X    findargs="-newer ${dd}/full -xdev"
Xfi
Xtempfile=${cat}/${name}.0.$$
Xtouch ${dd}/.${name}
Xtrap 'rm -f ${tempfile}; exit 1' 1 2 3 15
X
Xerrpt > /tmp/full.$$
X
Xcd /
X(
X    for i in ${filelist}; do
X	find $i ${findargs} -print
X    done
X) | tee ${tempfile} | /etc/backup -q -if${tape}
Xrc="$?"
Xif [ "$rc" = "0" ]; then
X    mv ${dd}/.${name} ${dd}/${name}
X    # seq="`cat ${cat}/.seq.${name}`"
X    # mv ${tempfile} ${cat}/${name}.$seq
X    # seq="`expr $seq + 1`"
X    # echo $seq > ${cat}/.seq.${name}
X    mv ${tempfile} ${cat}/${name}.daily
Xelse
X    echo "problem with backup?"
Xfi
X
Xecho "\nerror report difference list for the period of the backup:"
Xerrpt | diff /tmp/full.$$ -
Xrm -f /tmp/full.$$
X
Xexit "$rc"
EOFMARK
chmod 755 ./incr
exit 0

-- sanders@cactus.org