PowerShell script exchange
Post Reply
matteu
Veeam Legend
Posts: 790
Liked: 125 times
Joined: May 11, 2018 8:42 am
Contact:

vss copy only sql

Post by matteu »

Hello,

I'm trying to set up the Copy only setting on the AAIP option and general tab but it doesn't work as I think.

My code here :

Code: Select all

$job = Get-VBRJob -Name "bkp_dc"
$VSSOptions = New-VBRJobVssOptions
$VSSOptions.VssSnapshotOptions.Enabled = $True
$VSSOptions.VssSnapshotOptions.IsCopyOnly = $True
Set-VBRJobVssOptions -Job $job -Options $VSSOptions
On powershell, I can the the attributes are updated but on the backup job, the option is "Process transaction logs"
david.domask
Veeam Software
Posts: 1653
Liked: 397 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: vss copy only sql

Post by david.domask »

Hey @matteu, just to make sure I get you right, you want to disable transaction log processing entirely or you just want the Guest Processing options to be copy only? Just not quite sure I'm getting it fully.

That is, you want this option the Transaction Logs option here to be "Perform Copy Only"?: https://helpcenter.veeam.com/docs/backu ... ob_vss.png

If so, then you need to first get the job Objects with Get-VBRJobObject.

Objects can be a few things:

Include == Something we intend to backup
Exclude == Excluded from backup
ExcludeDisksChild == Excluded disks

There are others, but mostly you care about includes.

Once you know the object(s) you want to set it on, you will then collect that Object's VSS options with Get-VBRJobVSSOptions and pass the JobObject to the -ObjectInJob parameter and save it to a variable. (e.g., $VSSJobOptions)

Edit $VSSJobOptions as you desire; in your case you want to set the property VssSnapshotOptions.IsCopyOnly = $True

Then you will do Set-VBRJobVSSOptions and pass the $VSSJobOptions you just configured as the parameter.

An example in code:

Code: Select all

PS F:\perjobbackups\vss-test> $job = Get-VBRJob -name 'vss-test'
PS F:\perjobbackups\vss-test> $jObjs = Get-VBRJobObject -Job $jOb
PS F:\perjobbackups\vss-test> $VSSJobObject = Get-VBRJobObjectVssOptions -ObjectInJob $jObjs[2]
PS F:\perjobbackups\vss-test> $VSSJobObject.VssSnapshotOptions.IsCopyOnly = $true
PS F:\perjobbackups\vss-test> Set-VBRJobObjectVssOptions -Object $jObjs[2] -Options $VSSJobObject

Name                      Type       ApproxSize       Location
----                      ----       ----------       --------
Private VMs               Include    55 MB            myvcenter.local...
David Domask | Product Management: Principal Analyst
matteu
Veeam Legend
Posts: 790
Liked: 125 times
Joined: May 11, 2018 8:42 am
Contact:

Re: vss copy only sql

Post by matteu »

Thanks for the answer.
It's working fine.

In my environment I use tag and I would like to know if it's possible or not to set the same action without joboject command ?
When I use documentation, I expect to use this : https://helpcenter.veeam.com/docs/backu ... ml?ver=110

Is it possible with the Set-VBRJobVssOptions to perform the same action or not ?

What I'm trying to do is to automate backup job creation with default settings and if I need some custom settings, I go to the job after launch the script and I customize it.
david.domask
Veeam Software
Posts: 1653
Liked: 397 times
Joined: Jun 28, 2016 12:12 pm
Contact:

Re: vss copy only sql

Post by david.domask »

Glad it worked :)

I was afraid of this question to be honest, as I was checking and I'm not sure how to set it with hierarchy objects at this time, that is, I'm not sure it's possible regrettably, but it might just be my ignorance. I tested a little last night but didn't find an obvious way, so maybe one of the other commenters here knows.
David Domask | Product Management: Principal Analyst
matteu
Veeam Legend
Posts: 790
Liked: 125 times
Joined: May 11, 2018 8:42 am
Contact:

Re: vss copy only sql

Post by matteu »

Thanks for your answer !

I have one solution, it's ok !
Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests