Forum Discussion

wnetobr's avatar
wnetobr
Level 3
11 years ago

Need a script to do an specific schedule job

Hi all! I have a Sym Backup Exec System Recovery 2010 and I´m trying to run a job at a specific time on the 1st Tuesday of each month. Well, turns out that it is not possible to do such selection i...
  • Markus_Koestler's avatar
    11 years ago

    This should do the trick: Just replace YOURJOBNAME with the job name of your specific job as it is displayed in the SSR console.

     

     

    '''''RunBESRjob.vbs''''''''''
     
    Option Explicit
     
    Dim oV2iAuto
     Dim oNet
     Dim oCurrentJob
     Dim oImageJob
     Dim sJobID
     Dim sJobName

     sJobName="YOURJOBNAME"
     
    '
     ' Step 1: Create a VProRecovery automation object
     '
     Set oV2iAuto = CreateObject("Symantec.ProtectorAuto")
     
    '
     ' Step 2: Connect to the local agent
     '
     WScript.Echo "Connecting..."
     Set oNet = CreateObject("Wscript.Network")
     Call oV2iAuto.Connect(oNet.ComputerName)
     
    '
     ' Find the image job ID
     '
     For Each oCurrentJob In oV2iAuto.ImageJobs

      if oCurrentJob.DisplayName = sJobName then

       sJobID = oCurrentJob.ID
       WScript.Echo "Job ID is: " & sJobID
       Set oImageJob = oCurrentJob
       WScript.Sleep 500 ' allow console time to refresh if it's running

     end if
     
     Next
     
    'Run the image job Now
     
    Call oV2iAuto.DoImageJob(oImageJob.ID, oImageJob.Constants.ImageTypeFull)