Using Powershell to trigger Backup Copy job V7

PowerShell script exchange

Using Powershell to trigger Backup Copy job V7

Veeam Logoby AdrianHinton » Sat May 03, 2014 9:13 pm

Hi there,

When I Google around for info on Backup copies and PoSH, I don't get many good results so I thought I would ask this here.

I have a bunch of Backup copy jobs that are configured as secondary targets for VBR jobs. I want to trigger some of them outside of the schedule that has been configured. I have tried using the code below:

Function Run-CopyJob{

PARAM([string]$jobname)

get-vbrjob | ?{$_.name -eq $jobname} | start-vbrjob -runasync

}

Run-CopyJob 'Backup-Copy job1'

'But I get the error:
4/05/2014 6:59:52 AM :: Failed to start job [Backup-Copy job1] Error: Another job process already in progress.
4/05/2014 6:59:57 AM :: Job [Backup-Copy job1] cannot be started. SessionId: [Long GUID], Timeout: [5.0000412 sec]

I tried disabling a job and then running the script, this started the job, but ended saying it was disabled.

Could someone please point me in the right direction to some doco or experience with this?

Thank you.
AdrianHinton
Enthusiast
 
Posts: 71
Liked: 5 times
Joined: Mon Apr 07, 2014 10:00 am
Full Name: Adrian Hinton

Re: Using Powershell to trigger Backup Copy job V7

Veeam Logoby tsightler » Sat May 03, 2014 10:13 pm 1 person likes this post

Backup Copy jobs run on a continuous schedule and can't be started like normal jobs. If you want to force a sync outside of the normal settings like the "Sync Now" function in the GUI you can use the Sync-VBRBackupCopyJob cmdlet like so:
Code: Select all
Sync-VBRBackupCopyJob -Job "<Job_Name>"
tsightler
Veeam Software
 
Posts: 4768
Liked: 1737 times
Joined: Fri Jun 05, 2009 12:57 pm
Full Name: Tom Sightler

Re: Using Powershell to trigger Backup Copy job V7

Veeam Logoby AdrianHinton » Sat May 03, 2014 10:16 pm

Thank you tsightler. I'll give it a crack. I'll also familiarize myself with all the cmdlets!
AdrianHinton
Enthusiast
 
Posts: 71
Liked: 5 times
Joined: Mon Apr 07, 2014 10:00 am
Full Name: Adrian Hinton

Re: Using Powershell to trigger Backup Copy job V7

Veeam Logoby tsightler » Sat May 03, 2014 10:31 pm 1 person likes this post

No problem, should work fine. The online HTML documentation is the most current for becoming familiar with the commands but certainly feel free to ask here as well as not everything is always obvious in the guide. Here's the link to the online Powershell guide:

http://helpcenter.veeam.com/backup/70/powershell/

And here's the section for the Sync-VBRBackupCopy cmdlet:

http://helpcenter.veeam.com/backup/70/p ... pyjob.html
tsightler
Veeam Software
 
Posts: 4768
Liked: 1737 times
Joined: Fri Jun 05, 2009 12:57 pm
Full Name: Tom Sightler


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 7 guests