PowerShell script exchange
Post Reply
cfrancy
Novice
Posts: 3
Liked: never
Joined: Apr 24, 2015 7:24 pm
Full Name: Chris
Contact:

Help me understand Sessions

Post by cfrancy »

I want to get information about the last few runs for a particular job. Duration, size, etc. I want to build a report off it. I have a job (onsite backup-09.example.org) that has been running and successfully completed lots of times.

So I figure there should be valid backup sessions right? But I get no results

Code: Select all

PS C:\Users\a-cfrancy> Get-VBRBackupSession -name 'onsite backup-09.example.org'

PS C:\Users\a-cfrancy> 
Ah, but I know sessions exist because I can get the last session?

Code: Select all

PS C:\Users\a-cfrancy> (Get-VBRJob -Name 'onsite backup-09.example.org').findlastsession()

BottleneckManager         : CJobBottleneckManager
Info                      : Veeam.Backup.Model.CBackupSessionInfo
Progress                  : Veeam.Backup.Model.CBackupProgressData
StartupMode               : Normal
JobSourceType             : HyperV
...
JobType                   : Backup
JobName                   : onsite backup-09.example.org
JobSpec                   : 
JobTypeString             : Other job type
Operation                 : 
Description               : 
BaseProgress              : 100
IsCompleted               : True
IsWorking                 : False
IsStarting                : False
IsPostprocessing          : False
JobId                     : b4ba4a3c-5d7c-456f-9a29-a0a5f893e7aa
Result                    : Success
State                     : Stopped
EndTime                   : 4/23/2015 10:13:59 PM
CreationTime              : 4/23/2015 10:00:04 PM
...
PS C:\Users\a-cfrancy> 
So why does there appear to be no sessions, and a last session? Am I confused about how this is supposed to work, or is this a 'technical issue' and my post is going to be summarily deleted like the sticky mentions? The documentation is lacking anything as far as useful and detailed examples, so I have no idea if what I am seeing is expected, or a bug.
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Help me understand Sessions

Post by veremin »

Can you use the following example to get list of sessions names and check whether the "onsite backup-09.example.org" is present there? Chances are, it's spelled a bit different or some character is missing:

Code: Select all

Get-VBRBackupSession | select name
Thanks.
cfrancy
Novice
Posts: 3
Liked: never
Joined: Apr 24, 2015 7:24 pm
Full Name: Chris
Contact:

Re: Help me understand Sessions

Post by cfrancy »

Code: Select all

Get-VBRBackupSession | Select-Object name

Name
----
onsite backup-09.example.org (Incremental)
onsite backup-09.example.org (Reverse Incremental) (Retry 1)
onsite backup-09.example.org (Reverse Incremental)
onsite backup-09.example.org (Reverse Incremental)
onsite backup-09.example.org (Reverse Incremental)
onsite backup-09.example.org (Incremental)
onsite backup-09.example.org (Incremental)
onsite backup-09.example.org (Reverse Incremental)
onsite backup-09.example.org (Reverse Incremental)
onsite backup-09.example.org (Reverse Incremental)
onsite backup-09.example.org (Incremental)
onsite backup-09.example.org (Reverse Incremental)
onsite backup-09.example.org (Reverse Incremental)
onsite backup-09.example.org (Reverse Incremental)
onsite backup-09.example.org (Reverse Incremental)
onsite backup-09.example.org (Incremental)
onsite backup-09.example.org (Reverse Incremental)
onsite backup-09.example.org (Reverse Incremental)
onsite backup-09.example.org (Full)
onsite backup-09.example.org (Reverse Incremental)
Thanks for the help, this game what what I need. Apparently the documentation lied to me.
http://helpcenter.veeam.com/backup/80/p ... ssion.html
The name of the session is a name of the job.
It seems to me that the docs should say something like the Session name will include the name of the job. When the docs say it IS the name of the job, I expect the job names and session names to be identical. Perhaps the command should actually have a parameter (-JobName) that lets you actually use the jobname as a filter. I thought I should have been able to do something like below and actually get all the sessions for all the jobs. But since the Session name is NOT exactly equal to the job name, the below does not return all the sessions for all the jobs, it just happens to return some of them.

Code: Select all

Get-VBRJob | % {Get-VBRBackupSession -Name $_.Name | Select-Object Name,CreationTime }
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Help me understand Sessions

Post by veremin »

Session name contains information regarding its type, such as Incremental, Full, Retry, etc. So, you might query sessions, filtering them out by name:

Code: Select all

Get-VBRBackupSession | where {$_.name -like "onsite backup-09.example.org*"}
Or by jobname:

Code: Select all

Get-VBRBackupSession | where {$_.jobname -eq "onsite backup-09.example.org"} 
Thanks.
cfrancy
Novice
Posts: 3
Liked: never
Joined: Apr 24, 2015 7:24 pm
Full Name: Chris
Contact:

Re: Help me understand Sessions

Post by cfrancy »

v.Eremin wrote:Session name contains information regarding its type, such as Incremental, Full, Retry, etc. So, you might query sessions, filtering them out by name
Right, I got that after your first post. What you have basically told me is that the documentation is wrong, or at least unclear. If someone says "FOO is BAR" I expect that to mean FOO = BAR.
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Help me understand Sessions

Post by veremin »

Chris, I've already asked our tech writers to fix the said inconsistency. If you come across any issue with our online documentation in future, feel free to use "Send Feedback" at the bottom of the page to report it directly to the responsible team. Thanks.
Post Reply

Who is online

Users browsing this forum: No registered users and 18 guests