1833760 Members
2253 Online
110063 Solutions
New Discussion

Date of LIF tape backup

 
Jeff Picton
Regular Advisor

Date of LIF tape backup

Attached is a korn shell script I have obtained to determine the date/time a LIF tape was backed up. When I run this, there is nothing output to stdout at all even though there is a print function at the ned of the script.

Can anyone answer why this apparently gets through the error checks but no output appears ?
7 REPLIES 7
Bernhard Mueller
Honored Contributor

Re: Date of LIF tape backup

Jeff,

add
set -x
before or after the variable declarations and start it in a shell. The output will show you what it does, where it exits etc.

Regards
Bernhard
Bernhard Mueller
Honored Contributor

Re: Date of LIF tape backup

Jeff,

instead of debugging a script you might want to try a more simplistic approach to obtain the date a recovery date was created:

mt -f /dev/rmt/0m rewind
dd if=/dev/rmt/0m | grep sysadm_message
# Output will be like
sysadm_message = "Recovery tape created from system: karlotto on Thu Oct 25 21:12:34 2001
Control-C
mt -f /dev/rmt/0m rewind

Regards,
Bernhard
Dietmar Konermann
Honored Contributor

Re: Date of LIF tape backup

The line is only printed if a file 'HPUX' is contained in the LIF volume. Have a look at the lifls -l output of the LIF file in question.

# mt -t /dev/rmt/0m
# dd if=/dev/rmt/0m of=/tmp/LIF bs=2k
# lifls -l /tmp/LIF

Best regards...
Dietmar.
"Logic is the beginning of wisdom; not the end." -- Spock (Star Trek VI: The Undiscovered Country)
Jeff Picton
Regular Advisor

Re: Date of LIF tape backup

Hi

Thanks for these suggestions, I'll try something when I next put the tape in (Its a veritable mile to the computer room and i'm doing incrementals at the moment)

Cheers

Jeff
Jeff Picton
Regular Advisor

Re: Date of LIF tape backup

When I do the lifls -l /tmp/LIF | grep HPUX | awk '{print$6}', I get the following output :

03/09/02

even though the recovery was dated 03/09/03. Why is this ?
john korterman
Honored Contributor

Re: Date of LIF tape backup

Hi,
well, the simple answer is that you get the sixth parameter of the line containing the string "HP".
Please, show us the output of lifls -l /tmp/LIF

regards,
John K.
it would be nice if you always got a second chance
Jeff Picton
Regular Advisor

Re: Date of LIF tape backup

Yes I realised this after the fact.

Thks anyway