PowerShell script exchange
Post Reply
masonit
Service Provider
Posts: 181
Liked: 12 times
Joined: Oct 09, 2012 2:30 pm
Full Name: Magnus
Contact:

Blocks skipped

Post by masonit » Jan 10, 2019 10:09 am

Hi

When using options "exclude swap file blocks" and "exclude deleted file blocks" I can see in the job statistics:

Deleted file blocks skipped: 797,0 MB
Swap file blocks skipped: 367,0 MB

I have found this info with powershell using Get-VBRTaskSession (Logger.GetLog().UpdatedRecords). But is it possible somehow to get the value part in the string (797,0) as a real value? Want to collect this info and don't want to interpret a string.

\Masonit

v.Eremin
Veeam Software
Posts: 15542
Liked: 1183 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Blocks skipped

Post by v.Eremin » Jan 10, 2019 5:29 pm

You need to parse the given string, get number of skipped blocks and then convert it to integer, using similar approach. Thanks!

masonit
Service Provider
Posts: 181
Liked: 12 times
Joined: Oct 09, 2012 2:30 pm
Full Name: Magnus
Contact:

Re: Blocks skipped

Post by masonit » Jan 14, 2019 3:36 pm

Ok, thanks.

\Masonit

v.Eremin
Veeam Software
Posts: 15542
Liked: 1183 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Blocks skipped

Post by v.Eremin » Jan 14, 2019 5:41 pm

You're welcome. Let us know, should more assistance be needed. Thanks!

tdewin
Veeam Software
Posts: 1356
Liked: 448 times
Joined: Mar 02, 2012 1:40 pm
Full Name: Timothy Dewin
Contact:

Re: Blocks skipped

Post by tdewin » Jan 17, 2019 8:15 am 1 person likes this post

Hi,

Here is some sample code how you could parse out the data:

Code: Select all

$datastr = "Deleted file blocks skipped: 797,0 MB"
if ($datastr -match ": ([0-9,]+) ([GMK])B") {
	<#if you the system uses a dot, you can use replace to change , to . $data = [double]$Matches[1].Replace(',',".")#>
	$data = [double]$Matches[1]
	$so = "","K","M","G","T","P"
	$databytes = $data*[Math]::Pow(1024,$so.IndexOf($Matches[2]))
	
	write-host $databytes
}

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests