|
From: Stelian P. <st...@po...> - 2003-10-20 10:30:01
|
On Fri, Oct 17, 2003 at 01:46:36PM -0400, dfp10 wrote:
> Hello!
> I have been using the following script on Solaris for many years> I would like
> to use a ported list on RHlinux9 but I am having trouble in finding equivalent
> Linux commands. (Feel free to use it on Solaris!).
Let's see...
>
> #!/bin/sh
> # @(#) backup-script 1.2 95/09/15
> #
> # simple dump script /usr/bin/ufsscript to do full dump of an entire system
> #
> # edit the following to suit your configuration
> #
> TAPE=/dev/rmt/0mbn # this should be the non-rewinding tape device
use /dev/nst0 under Linux.
>
> # use this for 2.3 GB 8mm drives
> #DUMPPARM="0ubdsf 126 54000 6000"
>
> # use this for 5GB (4mm & 8mm) drives
> # DUMPPARM="0ubdsf 126 54000 13000"
> # same but COMPRESSED
> DUMPPARM="0ubdsf 126 54000 26000"
> # DUMPPARM="0ubdsf 126 50800 740"
> # DUMPPARM="0cfu"
> # run from a shell tool or a cron. By default it backs up the entire
> # system. For incremental backups replace the DUMPPARM line with
> # DUMPPARM="xubdsf 126 nnnnnn nnnnn"
Those are usable as is, although you may want to replace
the -d/-s combination with a simple -b.
> # the x in place of 0 means incremental dump, or only the stuff
> # thats changed since the last since the last incremental dump was
> # done. Take a full (level 0)and save it in case of hd cashes.
> # Periodically run an incremental or a full dump (depending on the
> # amount of data change on the machine
> # to dump specific filesystems, set FILESYS to a list of
> # the devices you want to dump. If FILESYS is null, all
> # ufs filesystems listed in /etc/vfstab will be dumped.
> FILESYS=""
>
> # to print useful recovery information (disk layout, dump list)
> # set PRINTER to the name of the printer you wish to spool
> # the output to. If PRINTER is null, no output will be produced
> PRINTER=parsons
>
> #----- shouldn't have to modify anything below here -----
> getfs() {
> if [ -z "$FILESYS" ]; then
> FILESYS=`awk '$1 !~ /^#/ && $4 == "ufs" {print $2}' </etc/vfstab`
> fi
> }
Use ext2 ou ext3 as search item into /etc/fstab
>
> getrootdisk() {
> ROOTDISK=`awk '$1 !~ /^#/ && $3 == "/" {print $2}' </etc/vfstab |
> sed -e 's/$s./s2/'`
> }
s/vfstab/fstab/
>
> # start of actual process
> PATH=/usr/bin:/usr/sbin:/sbin; export PATH
> echo "Dump started at `date`"
> mt -f $TAPE rewind
> getfs
> for i in $FILESYS
> do
> echo "Starting $i at `date`"
> ufsdump $DUMPPARM $TAPE $i >/dev/null
s/ufsdump/dump/
> echo ufsdump $DUMPPARM $TAPE $i
> echo "Finished $i at `date`"
> done
>
> # if [ -n "$PRINTER" ];
> # then
> # (
> echo "Dump done on `date`"
> echo ""
> echo "Tape contains the following partitions, in sequence"
> for i in $FILESYS
> do
> echo $i
> done
> echo ""
> getrootdisk
> prtvtoc $ROOTDISK
> # ) | lp -d$PRINTER
> # unexpected end of file at last line
> fi
> # report errors to screen
> iostat -En
> ********************************
Damn, didn't see you already started the job :)
> STARTING to port to Linux:
> #!/bin/sh
> # @(#) backup-script
> # /sbin/ext3script.tot Modified for RedHat9
> # simple dump script /usr/bin/ufsscript to do full dump of an entire system
> # edit the following to suit your configuration
>
> TAPE=/dev/nst0 # this should be the non-rewinding tape device
> # use this for 2.3 GB 8mm drives
> #DUMPPARM="0ubdsf 126 54000 6000"
> # use this for 5GB (4mm & 8mm) drives
> # DUMPPARM="0ubdsf 126 54000 13000"
> # same but COMPRESSED
> #DUMPPARM="0ubdsf 126 54000 26000"
> # DUMPPARM="0ubdsf 126 50800 740"
> # DUMPPARM="0cfu"
> ***I have not yet found good equivalents in the following:
>
> DUMPPARM="0b 64" #u=update dump dates cannot be used ,b<=64kb
Yes -u can be used
and b can be > 64kb in more recent versions of dump.
>
> # to dump specific filesystems, set FILESYS to a list of
> # the devices you want to dump. If FILESYS is null, all
> # ext3 ufs filesystems listed in /etc/fstab /etc/vfstab will be dumped.
>
> FILESYS="" #/,/data,/home,/opt,/spare,/usr,/usr/local,/var"
> *** I cannot get a read of ext3 in fstab or a comma seperated list of file
> systems
Hmm, why ?
>
> # to print useful recovery information (disk layout, dump list)
> #dfp10 set PRINTER to the name of the printer you wish to spool
> # the output to. If PRINTER is null, no output will be produced
> PRINTER=parsons
> #----- shouldn't have to modify anything below here -----
> getfs() {
> if [ -z "$FILESYS" ]; then
> FILESYS=`awk '$1 !~ /^#/ && $4 == "ext3" {print $2}' </etc/fstab`
> fi
> }
> getrootdisk() {
> ROOTDISK=`awk '$1 !~ /^#/ && $3 == "/" {print $2}' </etc/fstab |
> /bin/sed -e 's/$s./s2/'`
> }
>
> # start of actual process
> PATH=/usr/bin:/usr/sbin:/sbin; export PATH
> echo "Dump started at `/bin/date`"
> /bin/mt -f $TAPE rewind
>
> getfs
>
> for i in $FILESYS
> do
> echo "Starting $i at `/bin/date`"
> /sbin/dump -$DUMPPARM -f $TAPE $i >/dev/null
> echo dump $DUMPPARM $TAPE $i
> echo "Finished $i at `/bin/date`"
> done
>
> # if [ -n "$PRINTER" ];
> # then
> # (
> echo "Dump done on `/bin/date`"
> echo ""
> echo "Tape contains the following partitions, in sequence"
> for i in $FILESYS
> do
> echo $i
> done
> echo ""
> getrootdisk
> *** the prtvtoc found in linux vxtools does not work in the same way as the
> Solaris prtvtoc
>
> /usr/bin/prtvtoc $ROOTDISK # prtvtoc is ? a linux equivalent
I dont know what prvtoc is supposed to do.
> # ) | lp -d$PRINTER
> # unexpected end of file at last line
> fi
> # report errors to screen
> iostat -En
> ********************************************
> I will appreciate your suggestions and will post any final working script.
> Thanks
Please break the script in small functions and post only the part that
doesn't work in the future.
Stelian.
--
Stelian Pop <st...@po...>
|