PowerShell script exchange
Post Reply
Dario.Palmisano
Enthusiast
Posts: 31
Liked: 2 times
Joined: Nov 11, 2013 7:22 am
Full Name: Dario Palmisano
Contact:

How to get the source backup in a copy bk job

Post by Dario.Palmisano »

Hello Everybody,

I am trying to get all the objects (from infrastracture, from backups, from jobs) a copy backup job has a source for sync.

I tried the following:

$cpJobName ="MyCopyBkJob"
$cpJob = Get-VBRJob -Name $cpJobName

then used "Get-VBRJobObject -Job $cpJob", but this return nothing, I suppose this command is not applicable to copy backup jobs.

So how can I get these objects from a copy backup job?

Thanks in advance

Dario
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: How to get the source backup in a copy bk job

Post by veremin »

What is selected as a source for a backup copy job? Job, VM or repository? Thanks.
Dario.Palmisano
Enthusiast
Posts: 31
Liked: 2 times
Joined: Nov 11, 2013 7:22 am
Full Name: Dario Palmisano
Contact:

Re: How to get the source backup in a copy bk job

Post by Dario.Palmisano »

In the specific it is a Job, but if possible, I would like to learn for all the possibilities.

I would really like if a guide were available where to learn the relations between objects, without disturbing you everytime...

Thank you very much for your kind cooperation

Best regards

Dario
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: How to get the source backup in a copy bk job

Post by veremin »

In case of backup jobs selected as a source, the following example should be helpful:

Code: Select all

Asnp VeeamPSSnapin
$Job = Get-VBRJob -name "Name of your Backup Copy Job"
foreach ($ID in $Job.LinkedJobIds.guid)
{
Get-VBRJob | where {$_.id -eq $ID} | select name
}
Thanks.
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: How to get the source backup in a copy bk job

Post by veremin »

Get-VBRJobObject will work, when a source is represented by individual VMs:

Code: Select all

$Job = Get-VBRJob -name "Name of your backup copy job"
$Job | Get-VBRJobObject
Thanks.
Dario.Palmisano
Enthusiast
Posts: 31
Liked: 2 times
Joined: Nov 11, 2013 7:22 am
Full Name: Dario Palmisano
Contact:

Re: How to get the source backup in a copy bk job

Post by Dario.Palmisano »

v.Eremin wrote:In case of backup jobs selected as a source, the following example should be helpful:

Code: Select all

Asnp VeeamPSSnapin
$Job = Get-VBRJob -name "Name of your Backup Copy Job"
foreach ($ID in $Job.LinkedJobIds.guid)
{
Get-VBRJob | where {$_.id -eq $ID} | select name
}
Thanks.
In my environment (v. 8), works only if I remove ".guid"

Many thanks
veremin
Product Manager
Posts: 20270
Liked: 2252 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: How to get the source backup in a copy bk job

Post by veremin »

In my case, both approaches work fine. So, it's up to you to use the one that you like most. Thanks.
Post Reply

Who is online

Users browsing this forum: No registered users and 19 guests