Quantcast
Channel: R&D Forums
Viewing all articles
Browse latest Browse all 9935

PowerShell • Re: Get-VBRBackupFile

$
0
0
Ok, last update from me... The lookup of the associated backup job to the copy job is very very expensive (slow). Looking at it a bit more the lookuponly needs to occur once by backup copy job that I am looping through.. So I have moved it outside of this function, and now just pass in the backup job name as a string (SourceBackup).

Code:

function Get-SOBRBackupFilePathFromBackupV12 {param([Parameter(Mandatory=$true, Position=0)][Object]$Backup,        [Parameter(Mandatory=$true, Position=1)]        [Object]$backupfile,        [Parameter(Mandatory=$true, Position=2)]        [String]$SourceBackup)    write-host "processing $($backupfile.FilePath)";$Repository = $Backup.FindRepository()[0];if($Repository.Type -eq "ExtendableRepository"){        $Extent = $Repository.GetRepositoryForExistingStorage($backupfile.Id);        if($Backup.JobID -eq '00000000-0000-0000-0000-000000000000'){            $JobName = $Backup.GetMetaFilePath().Elements[0];        }Else{            $jobName = $Backup.FindJob().Name;        }        $BackupFileSOBRSANPath = "$($Extent.Path.ToString(),$JobName.ToString(),$SourceBackup.ToString(),$backupfile.filepath -join "/")";} else {$BackupFileSOBRSANPath = $backupfile.PartialPath;}    #Replace prohibitied path characters    $BackupFileSOBRSANPath = $BackupFileSOBRSANPath -replace ' |:', '_';return $BackupFileSOBRSANPath;}
So the call to the function now looks like this...

Code:

$backupFileSOBRSANPath = Get-SOBRBackupFilePathFromBackupV12 -Backup $backup -backupfile $backupFile -SourceBackup $SourceBackup.jobname;

Statistics: Posted by allan.warner — Nov 01, 2024 10:00 pm



Viewing all articles
Browse latest Browse all 9935

Latest Images

Trending Articles



Latest Images