I'm trying to obtain the last backup size of backup and backup copy jobs. Using the method below I'm able to retrieve a size for a backup but not he corresponding backup copy job. This is true for all copy jobs. They all report complete/successful and have a size in the console.
Code: Select all
PS C:\> $backup = Get-VBRBackup -Name server_bu_copy
PS C:\> $backup.FindLastFullUncorruptedStorage()
PS C:\> $backup.FindLastFullUncorruptedStorage().stats
PS C:\> $backup = Get-VBRBackup -Name server
PS C:\> $backup.FindLastFullUncorruptedStorage().stats
BackupSize DataSize DedupRatio CompressRatio
---------- -------- ---------- -------------
46259077120 137438995313 68 49
Code: Select all
# Get a list of the scheduled jobs
$Jobs = Get-VBRJob | ?{$_.IsScheduleEnabled -eq "True"} | Sort Name
# Now create the VM report
ForEach ($Job in $Jobs) {
$VMReport += Get-VBRTaskSession $Job.FindLastSession() | Select-Object Name ,JobName ,Status,
@{Name="StartTime"; Expression = {$_.Progress.StartTimeLocal}},
@{Name="StopTime"; Expression = {$_.Progress.StopTimeLocal}},
@{Name="Duration"; Expression = {'{0:00}:{1:00}:{2:00}' -f $_.Progress.Duration.Hours, $_.Progress.Duration.Minutes, $_.Progress.Duration.Seconds}},
@{Name="SizeGB"; Expression = {[math]::Round(($_.Progress.ProcessedSize/1GB),3)}},
@{Name="UsedGB"; Expression = {[math]::Round(($_.Progress.ProcessedUsedSize/1GB),3)}},
@{Name="ReadGB"; Expression = {[math]::Round(($_.Progress.ReadSize/1GB),3)}},
@{Name="TransferedGB"; Expression = {[math]::Round(($_.Progress.TransferedSize/1GB),3)}},
@{N="Busy";E={($_.Logger.GetLog().updatedrecords.title | where {$_ -like "Busy*"}) -replace 'Busy: Source', 'Src' -replace 'Network', 'Net' -Replace 'Target', 'Tar' -Replace 'Proxy', 'Prx'}},
@{N="Used Proxy";E={($_.Logger.GetLog().updatedrecords.title | where {$_ -like "Using backup proxy*"}) -replace 'Using backup proxy ','' -replace 'for disk Hard','-'}}
}
Thanks in advance