Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!romp!auschs!awdprime!sanders.austin.ibm.com!sanders From: sanders@sanders.austin.ibm.com (Tony Sanders) Newsgroups: comp.unix.aix Subject: Re: system backups Message-ID: <7617@awdprime.UUCP> Date: 15 May 91 18:26:07 GMT References: <1991May14.073311.14483@mtu.edu> Sender: news@awdprime.UUCP Organization: IBM AWD, Austin Lines: 143 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