Operating System - Tru64 Unix
1753664 Members
5788 Online
108798 Solutions
New Discussion юеВ

How to capture exit status of vdump

 
SOLVED
Go to solution
Victor Semaska_3
Esteemed Contributor

How to capture exit status of vdump

Greetings,

Here's my problem. I've written a script in ksh to back up /, /usr, & /var over the network to a remote server using vdump & SSH. I can't use rvdump because the policy is to have all network traffic encrypted.

The command looks basically like this:

vdump -b 60 -0Cf - //clone | ssh @ "dd obs=60k of="
STAT=$?

I left out things like the use of SSH public keys, etc.

What I do is use clonefset to create a AdvFS clone and then back that up. I then check STAT to see what the exit status was. The problem here is the exit status is for the ssh command. I want to see the exit status of the vdump command. Without getting into details I have had vdump fail a couple of times but wasn't aware of it because the exit status was for ssh.

Any ideas on how to capture the exit status of vdump?

Thanks in advance for any help.
Vic
There are 10 kinds of people, one that understands binary and one that doesn't.
3 REPLIES 3
Erich Wimmer
Valued Contributor
Solution

Re: How to capture exit status of vdump

Victor,
pack your "vdump" command in a shell script and process the returncode of vdump in the same script:

vdump.sh|ssh .....

vdump.sh:

#!/bin/ksh
vdump -b 60 -0Cf ......
if [ $? != 0 ]
then
....

Regards, Erich.
Alexey Borchev
Regular Advisor

Re: How to capture exit status of vdump

I've got a script - see attachment
The fire follows shedule...
Victor Semaska_3
Esteemed Contributor

Re: How to capture exit status of vdump

Bingo! Thanks to you two I have a solution.

Vic
There are 10 kinds of people, one that understands binary and one that doesn't.