Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to check status of mksysb 1

Status
Not open for further replies.

shailla

Programmer
Dec 25, 2002
2
MY
Hi...

I'm still new in unix environment. I need your help for
checking the status on mksysb after done.
I'm used this command to run the backup:

0 21 24 * * /usr/bin/mksysb -i /dev/rmt0

rgds

 
Hi Shailla,
you have to redirect output of mksysb, for example
0 21 24 * * /usr/bin/mksysb -i /dev/rmt0 > /tmp/mksysb.output 2>&1
(Use better mksysb -m -i /dev/rmt0)
Regards Boris
 
The simplest thing to do is just check the status value at the end. If it completes successfully it will return zero otherwise a positive value

rather than call mksysb directly from cron, write a script which calls mksysb then checks $? and performs error handling as desired. You can also extend it to do things such as check that tape before starting the backup.

I wouldn't recommend using the -m option , the -i is good enough though I do also use the -p option after having had packing problems with some tape drives.

Dave
 
You might try this:

# tctl rewind
# tctl -f /dev/rmt0.1 fsf 3
# restore -Tqvf /dev/rmt0.1 >/dev/null
# echo $?

0=ok
1=error

 
Or this:

The mksysb tape has 4 images on it:

------------------------------------------------------------
boot image | install image | empty TOC | system backup image
------------------------------------------------------------

To test the first 3 images, use the following commands. All this
does is checks for tape media errors. If you want to be absolutely
sure, boot the tape.

# The first 3 images are always written in 512 byte blocks
#
chdev -l rmt0 -a block_size=512
dd if=/dev/rmt0.1 of=/dev/null
dd if=/dev/rmt0.1 of=/dev/null
dd if=/dev/rmt0.1 of=/dev/null

To test the 4th image, use the commands:

# The system backup image is written at whatever block size the
# tape device was set to when the mksysb was made. You might
# assume 512 and skip the commands up through 'chdev' and the
# optional 'ibs' parameter to dd in the subsequent section. If
# you do and the block size is not 512, you'll get an I/O error.
#
tctl rewind
restore -xqvf /dev/rmt0.1 -s2 ./tapeblksz
chdev -l rmt0 -a block_size=$(awk '{ print $1 }' tapeblksz)

dd if=/dev/rmt0 [ibs=$(awk '{ print $1 }' tapeblksz)] |
restore -Tqf- >/dev/null
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top