ufsdump log question

ufsdump log question

Post by bad_fro » Thu, 09 Mar 2000 04:00:00



Greetings everyone.

Our library just recently purchased a new Sun workstation.  I'm
currently working on the backup cron job.  The vendor that sold
us the Sun will only support backups using ufsdump.  I wrote the
cron jobs and set the crontab file and everything is running
fine.

What I want is to create a series of log files to report the
backup results.  I know that ufsdump has three exit status
values: 0 (normal), 1 (error), and 3 (abort).  What I want to
know is if it's possible to 1) echo the screen output to another
file for review (in case of errors or aborts) and 2) if a notice
can be sent to one of three files based on the exit status (i.e.
bu.log, bu.err, bu.abort)?  If both of these are possible, what
do I need to do to make it so.

Thanks in advance.

Eric Speas
Automation Librarian
J.D. Boyd Library

* Sent from RemarQ http://www.remarq.com The Internet's Discussion Network *
The fastest and easiest way to search and participate in Usenet - Free!

 
 
 

ufsdump log question

Post by jeff » Thu, 09 Mar 2000 04:00:00


The easy way to create a log file of the ufsdump command is to redirect it
into a file  (ufsdump .......  > /path_to_file/file_name).

If you want to "separate" level 0, 1 & 3, you can do as follow (it is what
I'm doing) :

    I create a script that's doing my ufsdump. In my crontab, the script is
executing and I redirect the answer into a mail  to the sysadmin group (0 7
* * * name_of_my_script 2>&1 | mailx -s "Ufsdump" sysadmin). Now, to
separate the three level, I use Microsoft Outlook to inspect the content of
the mail.

    For me, it's working very well
hope I helped you



Quote:> Greetings everyone.

> Our library just recently purchased a new Sun workstation.  I'm
> currently working on the backup cron job.  The vendor that sold
> us the Sun will only support backups using ufsdump.  I wrote the
> cron jobs and set the crontab file and everything is running
> fine.

> What I want is to create a series of log files to report the
> backup results.  I know that ufsdump has three exit status
> values: 0 (normal), 1 (error), and 3 (abort).  What I want to
> know is if it's possible to 1) echo the screen output to another
> file for review (in case of errors or aborts) and 2) if a notice
> can be sent to one of three files based on the exit status (i.e.
> bu.log, bu.err, bu.abort)?  If both of these are possible, what
> do I need to do to make it so.

> Thanks in advance.

> Eric Speas
> Automation Librarian
> J.D. Boyd Library

> * Sent from RemarQ http://www.remarq.com The Internet's Discussion Network
*
> The fastest and easiest way to search and participate in Usenet - Free!


 
 
 

ufsdump log question

Post by Logan Sh » Fri, 10 Mar 2000 04:00:00




>Greetings everyone.

>Our library just recently purchased a new Sun workstation.  I'm
>currently working on the backup cron job.  The vendor that sold
>us the Sun will only support backups using ufsdump.  I wrote the
>cron jobs and set the crontab file and everything is running
>fine.

>What I want is to create a series of log files to report the
>backup results.  I know that ufsdump has three exit status
>values: 0 (normal), 1 (error), and 3 (abort).  What I want to
>know is if it's possible to 1) echo the screen output to another
>file for review (in case of errors or aborts) and 2) if a notice
>can be sent to one of three files based on the exit status (i.e.
>bu.log, bu.err, bu.abort)?  If both of these are possible, what
>do I need to do to make it so.

Sure, this can be done with simple Bourne shell programming:

        #! /bin/sh

        TAPE=/dev/rmt/0n
        export TAPE

        logdir=/var/adm/log/bu  # or whatever

        level=0
        blockf=64

        for fs in / /var /usr /opt /home /whatever/else
        do

                mt status
                echo

                ufsdump "$level"ubf "$blockf" "$TAPE" "$fs"

                case $? in
                0) logfile=normal ;;
                1) logfile=error ;;
                3) logfile=abort ;;
                *) logfile=other ;;
                esac

                echo

                logfile="$logdir/$logfile"

                echo "level $level filesystem $filesystem date `date`" >> $logfile"
        done

        mt status

Sending the output elsewhere can of course be done with redirection,
and maybe the "tee" command.  You'd do the ufsdump command something
like this:

        ufsdump 0ubf 64 /dev/rmt/0n /file/system 2>&1 | tee mylogfile

Or heck, run your entire script (or your entire main loop) into a
"tee logfile" command.  Put it in cron if you want:

        0 3 * * * /var/adm/mybackupscript 2>&1 | tee -a /var/adm/log/backuplog

Hope that helps.

  - Logan

 
 
 

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. Low Performance on 386/25

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

4. FXP problem

5. logging the contents of a ufsdump with ufsrestore

6. CA's Tape backup software

7. How to keep log when using ufsdump

8. Compiling a kernel & changing a serial port interrupt.

9. ufsdump log

10. ufsdump to log file

11. Solaris 8 ufsdump much slower than Solaris 7 ufsdump

12. Why so many ufsdump processes after I type "ufsdump 0f /dev/null /"?

13. QUESTION: on /var/log/secure logging ....