Check if the last backup job was a synthetic full backup

PowerShell script exchange

Check if the last backup job was a synthetic full backup

Veeam Logoby DG! » Thu Apr 11, 2013 11:11 am

Hallo,
I need to check if the last run of a job was a synthetic full backup. With

Code: Select all
$job = Get-VBRJob -Name "MyJob"
$session = $job.FindLastSession()


I get the last job session. But it is possible to get the information if this session was a synthetic full backup?

Thanks.
DG!
Novice
 
Posts: 3
Liked: never
Joined: Thu Apr 11, 2013 9:21 am

Re: Check if the last backup job was a synthetic full backup

Veeam Logoby v.Eremin » Thu Apr 11, 2013 1:35 pm

In the way I see it, it’s not possible at the moment .

Even though, you can understand whether the last session was an active full backup by running special command, you can’t get similar information regarding synthetic full backup, probably, due to the fact that it generally has two steps:

1. Creating a normal incremental.
2. Merging existing .vib files to one .vbk-files.

And these steps from PS perspective are considered as onr incremental backup session.

Anyway, if you're willing to understand whether the last session was an active full backup you can run the following script:

Code: Select all
Asnp VeeamPSSnapin
$Job = Get-VBRJob -name "Name of your job"
$Session = $Job.GetLastSession()
$Session.IsFullMode


Hope this helps.
Thanks.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Check if the last backup job was a synthetic full backup

Veeam Logoby tsightler » Thu Apr 11, 2013 2:17 pm 1 person likes this post

You can always get creative and parse the session log to determine if the last session included the synthetic, perhaps something like:

Code: Select all
asnp "VeeamPSSnapin" -ErrorAction SilentlyContinue
$job = Get-VBRJob -Name "Core Servers"
if ($job.GetLastSession().Logger.GetLog().UpdatedRecords.Title | Select-String "Transform") {
      write-host "Session Included Synthetic Full"
}


The above grabs the logs of the session and looks for a line with the word "Transform" in it. Sorry, at the moment I couldn't remember the exact wording used in the logs to denote a synthetic so you might need to search for a different keyword, but this should allow you to determine if the synthetic was part of the session in question.
tsightler
Veeam Software
 
Posts: 4768
Liked: 1737 times
Joined: Fri Jun 05, 2009 12:57 pm
Full Name: Tom Sightler

Re: Check if the last backup job was a synthetic full backup

Veeam Logoby v.Eremin » Thu Apr 11, 2013 2:36 pm

Oh, brilliant solution, Tom.

Just to update it with the correct wording:

Code: Select all
Asnp VeeamPSSnapin
$job = Get-VBRJob -Name "Core Servers"
if ($job.FindLastSession().Logger.GetLog().UpdatedRecords.Title | Select-String "Synthetic") {write-host "Session Included Synthetic Full”}


Hope this helps.
Thanks.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Check if the last backup job was a synthetic full backup

Veeam Logoby tsightler » Fri Apr 12, 2013 1:38 am

Thanks Vladimir, I couldn't remember the exact wording. I think it actually might even change between "Synthetic" and "Transform" based on whether the "Transform incremental into rollbacks" option is selected.
tsightler
Veeam Software
 
Posts: 4768
Liked: 1737 times
Joined: Fri Jun 05, 2009 12:57 pm
Full Name: Tom Sightler

Re: Check if the last backup job was a synthetic full backup

Veeam Logoby DG! » Mon Apr 15, 2013 6:40 am

Hi,
thanks for the help. The idea is good, but the log output of the synthetic full backup from the weekend is:

Code: Select all
Job finished at 13.04.2013 21:52:57
Primary bottleneck: Source
Load: Source 96% > Proxy 16% > Network 6% > Target 7%
Transformation completed successfully
All VMs have been processed
Processing 'VM1'
Preparing next VM for processing
Processing 'VM2'
.....
Preparing next VM for processing
Changed block tracking is enabled
VM size: 669,0 GB
Building VM list
Job started at 13.04.2013 01:00:12


There is no information about the synthetic part. Can I increase the log level to get the information?
DG!
Novice
 
Posts: 3
Liked: never
Joined: Thu Apr 11, 2013 9:21 am

Re: Check if the last backup job was a synthetic full backup

Veeam Logoby v.Eremin » Mon Apr 15, 2013 7:08 am

Actually, there is a line regarding synthetic full in the log-snippet provided by you. The following one:

Transformation completed successfully

This means that previous incrementals have been transformed successfully into rollbacks during synthetic full run. This option can only be selected as a part of synthetic full backup.

So, you can slightly modify the aforesaid script:

Code: Select all
Asnp VeeamPSSnapin
$job = Get-VBRJob -Name "Core Servers"
if ($job.FindLastSession().Logger.GetLog().UpdatedRecords.Title | Select-String "Synthetic") {write-host "Session Included Synthetic Full”}
if ($job.FindLastSession().Logger.GetLog().UpdatedRecords.Title | Select-String "Transformation") {write-host "Session Included Synthetic Full. Previous restore points have been successfully transformed into rollbacks.”}


Hope this helps.
Thanks.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Check if the last backup job was a synthetic full backup

Veeam Logoby DG! » Mon Apr 15, 2013 1:24 pm

Thanks, works great.
DG!
Novice
 
Posts: 3
Liked: never
Joined: Thu Apr 11, 2013 9:21 am

[MERGED] : Get days that synthetic fulls are created on

Veeam Logoby xadamz23 » Mon Nov 17, 2014 8:58 pm

Using powershell can I get the days that synthetic fulls are created on? For every backup job so that the output lists the job name and the day(s) that syn fulls are created?

Running Veeam B&R 7 with patch 4.

Thanks
xadamz23
Influencer
 
Posts: 17
Liked: 3 times
Joined: Tue Dec 08, 2009 10:24 pm

Re: Check if the last backup job was a synthetic full backup

Veeam Logoby v.Eremin » Tue Nov 18, 2014 8:17 am

You should query backup sessions, and try to find the lines that indicate synthetic full backup creation. Modify the script provided by Tom, so that, not only the last backup session, but all backup sessions get checked. Thanks.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

Re: Check if the last backup job was a synthetic full backup

Veeam Logoby xadamz23 » Tue Nov 18, 2014 2:32 pm

v.Eremin wrote:You should query backup sessions, and try to find the lines that indicate synthetic full backup creation. Modify the script provided by Tom, so that, not only the last backup session, but all backup sessions get checked. Thanks.


Right I understand that. But what I want to do is query the job options. Is it possible to query the job options to get the days syn fulls are created on? Say for example I have Sunday and Wednesday "checked" for syn fulls in the job options. Can I use powershell to query that job's options to find the days I have it configured to do syn fulls?
xadamz23
Influencer
 
Posts: 17
Liked: 3 times
Joined: Tue Dec 08, 2009 10:24 pm

Re: Check if the last backup job was a synthetic full backup

Veeam Logoby v.Eremin » Tue Nov 18, 2014 2:38 pm 1 person likes this post

Then, the following script should help:

Code: Select all
Get-VBRJob -name "Name of your backup Job" | select name, {$_.options.BackupTargetOptions.TransformToSyntethicDays}


Thanks.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 6 guests