How to get the source backup in a copy bk job

PowerShell script exchange

How to get the source backup in a copy bk job

Veeam Logoby Dario.Palmisano » Wed Feb 18, 2015 7:50 am

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
Dario.Palmisano
Enthusiast
 
Posts: 29
Liked: 2 times
Joined: Mon Nov 11, 2013 7:22 am
Full Name: Dario Palmisano

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

Veeam Logoby v.Eremin » Wed Feb 18, 2015 10:00 am

What is selected as a source for a backup copy job? Job, VM or repository? Thanks.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

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

Veeam Logoby Dario.Palmisano » Wed Feb 18, 2015 10:17 am

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
Dario.Palmisano
Enthusiast
 
Posts: 29
Liked: 2 times
Joined: Mon Nov 11, 2013 7:22 am
Full Name: Dario Palmisano

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

Veeam Logoby v.Eremin » Wed Feb 18, 2015 10:20 am

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.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

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

Veeam Logoby v.Eremin » Wed Feb 18, 2015 11:02 am

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.
v.Eremin
Veeam Software
 
Posts: 13266
Liked: 968 times
Joined: Fri Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin

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

Veeam Logoby Dario.Palmisano » Wed Feb 18, 2015 11:56 am

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
Dario.Palmisano
Enthusiast
 
Posts: 29
Liked: 2 times
Joined: Mon Nov 11, 2013 7:22 am
Full Name: Dario Palmisano

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

Veeam Logoby v.Eremin » Wed Feb 18, 2015 12:18 pm

In my case, both approaches work fine. So, it's up to you to use the one that you like most. 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 4 guests