PowerShell script exchange
Post Reply
DG!
Novice
Posts: 5
Liked: never
Joined: Apr 11, 2013 9:21 am
Contact:

Check if the last backup job was a synthetic full backup

Post by DG! »

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.
veremin
Product Manager
Posts: 20283
Liked: 2258 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

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

Post by veremin »

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.
tsightler
VP, Product Management
Posts: 6011
Liked: 2843 times
Joined: Jun 05, 2009 12:57 pm
Full Name: Tom Sightler
Contact:

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

Post by tsightler » 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.
veremin
Product Manager
Posts: 20283
Liked: 2258 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

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

Post by veremin »

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.
tsightler
VP, Product Management
Posts: 6011
Liked: 2843 times
Joined: Jun 05, 2009 12:57 pm
Full Name: Tom Sightler
Contact:

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

Post by tsightler »

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.
DG!
Novice
Posts: 5
Liked: never
Joined: Apr 11, 2013 9:21 am
Contact:

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

Post by DG! »

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?
veremin
Product Manager
Posts: 20283
Liked: 2258 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

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

Post by veremin »

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.
DG!
Novice
Posts: 5
Liked: never
Joined: Apr 11, 2013 9:21 am
Contact:

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

Post by DG! »

Thanks, works great.
xadamz23
Influencer
Posts: 17
Liked: 3 times
Joined: Dec 08, 2009 10:24 pm
Contact:

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

Post by xadamz23 »

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
veremin
Product Manager
Posts: 20283
Liked: 2258 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

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

Post by veremin »

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.
xadamz23
Influencer
Posts: 17
Liked: 3 times
Joined: Dec 08, 2009 10:24 pm
Contact:

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

Post by xadamz23 »

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?
veremin
Product Manager
Posts: 20283
Liked: 2258 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

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

Post by veremin » 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.
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 15 guests