logging the contents of a ufsdump with ufsrestore

logging the contents of a ufsdump with ufsrestore

Post by John » Sat, 25 Aug 2001 00:25:10



Hello,

   I am new to Unix and Solaris.  I have a backup script that is
kicked off by the cron.  The script is as follows:

mt -f /dev/rmt/0cbn rewind
ufsdump 0f /dev/rmt/0cbn /
ufsdump 0f /dev/rmt/0cbn /space
ufsdump 0f /dev/rmt/0cbn /data2
ksh /space/home/jnokes/bin/restorelog
mt -f /dev/rmt/0cbn rewind
mt -f /dev/rmt/0cbn offl

I just added the "ksh /space/home/jnokes/bin/restorelog" line.  My
intent is to log all the files that were backed up.  The restorelog
script is as follows:

#!ksh

# This script will log what files were backed up  

for i in 1 2 3
do
     LOGBASE=/data2/backuplog/backupPar_$i.log
     LOG=$LOGBASE.$(date +%m%d)
     ufsrestore tfs /dev/rmt/0 $i > $LOG
done

My question is how do I include the header for each dump in its log
file?  We reuse our tapes and I want to make sure I am listing the
files that were backed up today and not displaying the files that were
backed up a week ago.
I am new to this so if I am going about this the wrong way I am open
to suggestions.

Thanks in advance.

John

 
 
 

1. part 2/2 of: running ufsdump under "script ufsdump.log"

Since, to my horror, I've been having a little trouble
matching what ufsrestore finds with what I *thought* ufsdump
was writing to the tape, some *crude* verification would
reassure me:

Maybe after ufsdumping a partition, my .sh-file could have it back up
one tape-position, via:

     mt bsf 2 /dev/rmt/0cn ; mt status /dev/rmt/0cn

             [quick on-the-fly question: about that "2": is
              that very-long-standing requirement to *tell*
              "mt bsf" to back up one *more* position than
              you really want -- is that a bug, or a
              "feature" -- and if a feature, what (fiction)
              do they use to *explain* it to someone? ]

and then it would run "ufsrestore -i", and have it do just a single
"ls" before "q-uing" out of it,
...              
at which point an
      "mt status /dev/rmt/0cn"

should show that the tape had returned to the *same* position it was
when that ufsdump finished -- ie, it's in position for the
*next* ufsdump to be done.

Question: Any idea how I'd code that ufsdump *and the
ufsrestore -i" via the Bourne shell?

(Taking the time to master "expect", for this one optional
verification-use, would be overkill, at least for me.)

Thanks for everything!

David

2. ASCII FILE

3. part 1/2 of: running ufsdump under "script ufsdump.log"

4. ncurses-1.9.9e/terminfo's console/linux files

5. Creating mirrored machine with "ufsdump and ufsrestore"

6. CD-CHANGER Problem Solved!!

7. Solaris 2.4 UFSDUMP/UFSRESTORE

8. Laptop XFree86 Install - esp. for C&T chipset

9. 1 * NAqqIsWqA-UFSDUMP and UFSRESTORE to a new disk

10. ufsdump and ufsrestore to another system

11. ufsrestore/ufsdump on Solaris Sparc/x86 incompatibility

12. ufsdump > ufsrestore ----- HELP

13. ufsdump, ufsrestore problem