10-15-2010 06:10 AM
i currently manage backups for around 100 systems. every morning i have a script that runs and checks the backup locations for all my systems to see if a backup was initiated. for the ones that weren't i have to get the users to manually start their backup. i am trying to find out how to write a script to start the backups on a machine remotely. any ideas??
10-15-2010 07:45 AM
This is a sample script you can customize for your environment:
'----------------------------------------------------------------------------------------- ' ' Symantec Backup Exec System Recovery 8.0 Automation ' ' Copyright (c) 2003-2007 by Symantec Corporation ' All Rights Reserved ' ' THIS SCRIPTING EXAMPLE IS PROVIDED IN CONJUNCTION WITH YOUR LICENSE FOR SYMANTEC ' BACKUP EXEC (TM) SYSTEM RECOVERY SOFTWARE PRODUCTS, AND MAY BE USED ONLY IN CONJUNCTION WITH ' THAT SOFTWARE, UNDER THE TERMS OF THE END USER LICENSE AGREEMENT THAT ACCOMPANIED ' THE SOFTWARE. THIS SCRIPTING EXAMPLE IS PROPRIETARY SYMANTEC PROPERTY. YOU MAY NOT ' COPY, DISTRIBUTE, LICENSE OR SUBLICENSE THE SCRIPTING DOCUMENTATION. ' '----------------------------------------------------------------------------------------- ' ' Example Script: Create an image of system drive to a passed-in network folder ' ' Objects Used: ProtectorAuto, ImageJob, Volume, NetworkLocation ' '----------------------------------------------------------------------------------------- Option Explicit Dim v2iAuto Dim oNet Dim oVolume Dim oTempVol Dim oNetLocation Dim oImageJob Dim sFolder ' ' Step 1: Process command line arguments ' If (WScript.Arguments.Count < 1) Then WScript.Echo "Usage: cscript.exe CreateImageNow.vbs [UNC Network Path]" WScript.Quit End If sFolder = WScript.Arguments(0) ' ' Step 2: Create a VProRecovery automation object ' Set v2iAuto = CreateObject("Symantec.ProtectorAuto") ' ' Step 3: Connect to the local agent ' WScript.Echo "Connecting..." Set oNet = CreateObject("Wscript.Network") Call v2iAuto.Connect(oNet.ComputerName) ' ' Step 4: Define the network location where the image will be saved (uses NetworkLocation) ' Set oNetLocation = CreateObject("Symantec.VProRecovery.NetworkLocation") oNetLocation.Path = sFolder oNetLocation.FileSpec = "SystemBackup" oNetLocation.NetworkUser = "DOMAIN\UserName" oNetLocation.NetworkPassword = "mypassword" ' ' Step 5: Find the volume to image (the system volume in this case) ' Set oVolume = Nothing For Each oTempVol in v2iAuto.Volumes(False) If (oTempVol.System) Then Set oVolume = oTempVol Exit For End If Next If (oVolume Is Nothing) Then _ Call Err.Raise(vbObjecterror+1, "CreateImageNow.vbs", "Cannot find requested volume.") ' ' Step 6: Create a manual image job that automatically removes itself after running ' Set oImageJob = CreateObject("Symantec.VProRecovery.ImageJob") oImageJob.IncrementalSupport = False oImageJob.DisplayName = "Recovery point of " & oVolume.DisplayName oImageJob.Description = "Test recovery point of the system volume." oImageJob.Compression = oImageJob.Constants.ImageCompressionLow oImageJob.Reason = oImageJob.Constants.ImageReasonManual oImageJob.Volumes = Array(oVolume.ID) oImageJob.Task = Nothing oImageJob.Location(oVolume.ID) = oNetLocation oImageJob.RunOnce = True ' ' Step 7: Add the image job to the list of jobs ' Call v2iAuto.AddImageJob(oImageJob) WScript.Echo "Image Job added successfully." ' ' Step 8: Run this image job now ' WScript.Echo "Creating image..." Call v2iAuto.DoImageJob(oImageJob.ID, oImageJob.Constants.ImageTypeFull) WScript.Echo "Image created successfully."
11-04-2010 12:03 PM
thats kind of what i am looking for. basically i already have backups jobs scheduled on the systems. what i wan to do is to have a script that i can psexec to manually start the scheduled job. any ideas?