PowerShell script exchange
Post Reply
btm
Novice
Posts: 4
Liked: never
Joined: Sep 16, 2020 12:04 pm
Contact:

Find size of data written to tape by tape job

Post by btm »

I would like to know how to get the information about how much data was transferred to tape.

Especially, I'm interested in this information:
https://i.imgur.com/UB4CGqv.png

I cannot find it in the Session I found with this command:

Code: Select all

$tapeSessions = (Get-VBRsession -job (Get-VBRTapejob | Select-Object -last 1)) | Where-Object {$_.CreationTime -ge (Get-Date).AddHours(-36)}
My current work-around is adding the size from all backups together, like so:

Code: Select all

$total_size = 0	
$backupJobNames = $tapeJob.object.name
ForEach ($backupJobName  in $backupJobNames)
{
	$total_size += (Get-VBRJob -Name $backupJobName).Info.IncludedSize
}
But that doesn't show me when there was no data transferred.

btm
Novice
Posts: 4
Liked: never
Joined: Sep 16, 2020 12:04 pm
Contact:

Re: Find size of data written to tape by tape job

Post by btm »

I found this impressive script:
https://blog.smasterson.com/2017/12/22/ ... ort-9-5-3/

With the relevant code here:

Code: Select all

      $arrAllSessTp = $sessListTp | Sort Creationtime | Select @{Name="Job Name"; Expression = {$_.Name}},
        @{Name="State"; Expression = {$_.State}},
        @{Name="Start Time"; Expression = {$_.CreationTime}},
        @{Name="Stop Time"; Expression = {If ($_.EndTime -eq "1/1/1900 12:00:00 AM"){"-"} Else {$_.EndTime}}},
        @{Name="Duration (HH:MM:SS)"; Expression = {Get-Duration -ts $_.Progress.Duration}},                    
        @{Name="Avg Speed (MB/s)"; Expression = {[Math]::Round($_.Info.Progress.AvgSpeed/1MB,2)}},
        @{Name="Total (GB)"; Expression = {[Math]::Round($_.Info.Progress.ProcessedSize/1GB,2)}},
        @{Name="Data Read (GB)"; Expression = {[Math]::Round($_.Info.Progress.ReadSize/1GB,2)}},
        @{Name="Transferred (GB)"; Expression = {[Math]::Round($_.Info.Progress.TransferedSize/1GB,2)}},                    
        @{Name="Details"; Expression = {($_.GetDetails()).Replace("<br />","ZZbrZZ")}}, Result
      $bodyAllSessTp = $arrAllSessTp | ConvertTo-HTML -Fragment
      If ($arrAllSessTp.Result -match "Failed") {
        $allSessTpHead = $subHead01err
      } ElseIf ($arrAllSessTp.Result -match "Warning" -or $arrAllSessTp.State -match "WaitingTape") {
        $allSessTpHead = $subHead01war
      } ElseIf ($arrAllSessTp.Result -match "Success") {
        $allSessTpHead = $subHead01suc
      } Else {
        $allSessTpHead = $subHead01
      }      
      $bodyAllSessTp = $allSessTpHead + "Tape Backup Sessions" + $subHead02 + $bodyAllSessTp
If I read this correctly, I should be able to get the information I want, by

Code: Select all

PS C:\Windows\system32> $tapeSessions | sort creationTime | select @{Name="Job Name"; Expression = {$_.Name}}, @{Name="Total "; Expression = {$_.Info.Progress.ProcessedSize}}, @{Name="Transferred "; Expression = {$_.Info.Progress.TransferedSize}}
But, the result is:

Code: Select all

Job Name            Total  Transferred
--------            ------ ------------
Full backup to tape
Full backup to tape

When I look at a single session, it doesn't have a Info property. Could this be because no data was transferred? Also, there is a spelling error in the word 'Transfered', but that seems to be on purpose, since the property in VEEAM has a spelling error as well.

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests