I plan to shift the synthetic full for Backup 2 to Monday (rather than Sunday).
Now is there a question in this post.......after writing it im not so sure
What do others do? My script is below, is there a better way to archive to tape?
Script
Code: Select all
# Remoting must be enabled on the BackupExec Server
# And user must have access to complete task on Veeam and BE
if ((Get-PSSnapin -Name VeeamPSSnapIn -ErrorAction SilentlyContinue) -eq $null) {
Add-PsSnapin VeeamPSSnapIn
}
$veeamJobName = "Backup 1"
$backupExecJob = "Veeam Backup 1"
$backupExecSvr = "MY-SERVER"
$backupExecPath = "C:\Program Files\Symantec\Backup Exec"
if ((Get-VBRJob | ?{$_.Name -eq $veeamJobName}).GetLastResult() -eq "Success") {
$latestOib = Get-VBRBackup | ?{$_.JobName -eq $veeamJobName} | Get-VBRRestorePoint | Sort CreationTime -Descending | Select -First 1
$latestOib
$storage = $latestOib.GetStorage()
$storage.FilePath
$file = Get-Item $storage.FilePath
if ($file.Attributes -band ([System.IO.FileAttributes]::Archive)) {
Invoke-Command -ComputerName $backupExecSvr -ScriptBlock {
param (
[PSObject]$storage,
[PsObject]$file,
[String]$backupExecJob,
[String]$backupExecPath
)
& "$backupExecPath\bemcmd.exe" -o2 -j:$backupExecJob -s:$storage.FilePath -m MediaName -r -w
$file.Attributes = 'Archive'
} -Argumentlist $storage, $file, $backupExecJob, $backupExecPath
}
}
Phil.