Hi people...
how to monitor if backup it was effected in BrightStor ARCserve Backup?
Thanks
Bidu
how to monitor if backup it was effected in BrightStor ARCserve Backup?
Thanks
Bidu
'**
'**
'**
'** Developed by Onno de Vries
'** Date : 01-02-2008
'** Version: 1.0
'** ArcServe V9-V11.5
'**
'*************************************************************************************
'** Several Declarations
'**
Const ForReading = 1, ForWriting = 2
Counter = 0
BackupJobFound = 0
ZeroFill = 0
DotWNum = weekday(now,1)
'**
'** Enable parsing arguments to the vbs and collect them
'** Agent Temp dir and the type of information to look for (status, summary, mediastatus, etc.) has to be given
'**
Set ArgObj = Wscript.Arguments
AgentTemp = ArgObj(0)
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.CreateTextFile(AgentTemp + "\TCONTC.txt")
If DotWNum = 1 OR DotWNum = 2 Then
objFile.WriteLine("No, it is a " & WeekDayName(weekday(now),0) & ". So a scheduled backup did not run the previous evening.")
Else
objFile.WriteLine("Yes, it is a " & WeekDayName(weekday(now),0) & ". So a backup check should be performed.")
End If
objFile.Close
'
' get the install path of ArcServe from the registry
'
const HKEY_LOCAL_MACHINE = &H80000002
strComputer = "."
Set StdOut = WScript.StdOut
Set oReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" &_
strComputer & "\root\default:StdRegProv")
strKeyPath = "HKEY_LOCAL_MACHINE\SOFTWARE\ComputerAssociates\BrightStor ARCserve Backup\Base\Path\"
strValueName = "LOG"
oReg.GetStringValue HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue
ArcServeLogPath = strValue & "\cas_user_logs\"
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile(AgentTemp + "\JobResult.txt", ForReading)
Do Until objFile.AtEndOfStream
strLine = objFile.ReadLine
If Instr(1, strLine, "Backup", 1) > 0 Then
Counter = Counter + 1
BackupJobFound = 1
JobID=LTrim(Mid(strLine, 7, 6))
JobType=LTrim(Mid(strLine, 13, 34))
JobResult=LTrim(Mid(strLine, 48, 14))
JobIDLength = Len(JobID)
Do Until ZeroFill = 7-JobIDLength
Fill = Fill & "0"
ZeroFill = ZeroFill + 1
Loop
JobLogName = "J" & Fill & JobID & ".log"
Set objFSOa = CreateObject("Scripting.FileSystemObject")
Set objFilea = objFSOa.CreateTextFile(AgentTemp + "\JobID" & Counter & ".txt")
objFilea.WriteLine(JobID)
objFilea.Close
Set objFSOa = CreateObject("Scripting.FileSystemObject")
Set objFilea = objFSOa.CreateTextFile(AgentTemp+ "\JobType" & Counter & ".txt")
objFilea.WriteLine(JobType)
objFilea.Close
Set objFSOa = CreateObject("Scripting.FileSystemObject")
Set objFilea = objFSOa.CreateTextFile(AgentTemp+ "\JobResult" & Counter & ".txt")
If Instr(1,JobResult,"Finished",1) > 0 Then
objFilea.WriteLine(JobResult & " Completed")
Else
objFilea.WriteLine(JobResult)
End If
objFilea.Close
Set objFSOa = CreateObject("Scripting.FileSystemObject")
Set objFilea = objFSOa.CreateTextFile(AgentTemp+ "\JobLogName" & Counter & ".txt")
objFilea.WriteLine(JobLogName)
objFilea.Close
End if
Loop
objFile.Close
If BackupJobFound = 0 Then
Set objFSOa = CreateObject("Scripting.FileSystemObject")
Set objFilea = objFSOa.CreateTextFile(AgentTemp+ "\NoBackupFound.txt")
objFilea.WriteLine("No Backup Job Found")
objFilea.Close
End if
Set objFSOa = CreateObject("Scripting.FileSystemObject")
Set objFilea = objFSO.CreateTextFile(AgentTemp + "\counter.txt")
objFilea.WriteLine(Counter)
objFilea.Close
Comment