Veritas-bu

[Veritas-bu] RE: Windows Script/Batch for Catalog Backups

2003-05-29 13:17:22
Subject: [Veritas-bu] RE: Windows Script/Batch for Catalog Backups
From: Jesse.Gardner AT storaenso DOT com (Gardner, Jesse)
Date: Thu, 29 May 2003 12:17:22 -0500
It appears as though a long line in my vbscript got cut in two when I sent
the email:

intActive = intActive +
int(mid(strCatArray(i),instr(strCatArray(i),"=")+1))

^ is supposed to be one line. "..intActive + int(mid(..."

Here's the script again (and it will probably cut it again).  Also, these
dashes shouldn't go in the .vbs file. They're just for visual separation in
this email.
-----------------------------------------
set objShell = CreateObject("WScript.Shell")

While GetActiveJobCount > 0     
        wscript.sleep 30000 'Wait 30 seconds and check again
Wend

'No Active jobs, do the catalog backup.
objShell.Run("bpbackupdb.exe")
Set objShell = Nothing

Function GetActiveJobCount()
        set oExec = objShell.Exec("bpdbjobs -summary -all_columns")
        intActive = 0
        If Not oExec.StdOut.AtEndOfStream then 'There's a line to read.
                strLine = oExec.StdOut.ReadLine()
                strCatArray = Split(strLine,",")
                for i = 1 to 3 'Look at Queued, ReQueued, and Active.
                        intActive = intActive +
int(mid(strCatArray(i),instr(strCatArray(i),"=")+1))
                next
                WScript.Sleep 25
        end if
        GetActiveJobCount = intActive
        set oExec = nothing
End Function
-----------------------------------------

<Prev in Thread] Current Thread [Next in Thread>