Triggering Copysync with powershell

PowerShell script exchange

Triggering Copysync with powershell

Veeam Logoby AdrianHinton » Tue Jan 06, 2015 9:36 pm

Hi,

At the end of specific backup jobs, I call a PowerShell (PS) script that triggers the associated copysync job. If the copysync job is already running, no action is taken. Occasionally I get alerts via Veeam One that say task was cancelled by user. Also in the powershell log, I can see that there are warnings and errors saying that the backup service was not disposed and not properly disposed respectively.

Can you please tell me how to dispose the backup service correctly in my script? And by doing so, will this get rid of the Veeam One alert?

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

Re: Triggering Copysync with powershell

Veeam Logoby nefes » Wed Jan 07, 2015 10:45 am

Why you ever need to trigger copysync (I assume, you mean Backup Copy) after backup job finished?
If you need to copy freshly created restorepoint, I assume "forward lookup" regkey is what you need (please see what's new document for details)
nefes
Veeam Software
 
Posts: 534
Liked: 125 times
Joined: Mon Dec 10, 2012 8:44 am
Full Name: Nikita Efes

Re: Triggering Copysync with powershell

Veeam Logoby AdrianHinton » Mon Jan 19, 2015 5:09 am

Why would I ever need to trigger a copy after the backup job had finished? Because there is no such option in the UI. Does the forward lookup do this? Whenever there is a new point created, it will copy it to the target and then wait for the next one? And continue like this forever?

Also, are you able to tell me how to dispose of the object properly?
AdrianHinton
Enthusiast
 
Posts: 71
Liked: 5 times
Joined: Mon Apr 07, 2014 10:00 am
Full Name: Adrian Hinton

Re: Triggering Copysync with powershell

Veeam Logoby nefes » Mon Jan 19, 2015 9:32 am

Backup copy is designed to sustain RPO it have, so copy only 1 RP per interval you set.
So if during 1 Backup Copy interval you have more than 1 RP of Backup job, only one of them will be copied.
If you want more points, you could make shorter interval of Backup Copy job. Please make sure that length of interval is sufficient to finish synchronization.

Forward Lookup key is designed to look RPs only created after start of interval. Say you have hourly backup job and daily backup copy started at midnight. Without that key job will copy latest point from yesterday, with the key it will copy first point of today.

About warning in Veeam One - it is generated if during interval you stopped with Sync Now there were no restore points copied, so you don't need to use Sync Now, new point will start copying itself. If Backup Copy already synched, warning should not be raised.

About "object is not disposed" - do you see that in powershell log file? If so, it will be great if you could open a support case - that should not happen, however usually that message in log is not dangerous and should not lead to any bad situation.
nefes
Veeam Software
 
Posts: 534
Liked: 125 times
Joined: Mon Dec 10, 2012 8:44 am
Full Name: Nikita Efes

Re: Triggering Copysync with powershell

Veeam Logoby AdrianHinton » Mon Feb 09, 2015 3:20 am

May I ask the reason why there is not an option to copy an RP and when there is a new one, copy that if another copy is not already in progress? This seems like an option that is needed. The idea is to backup and store redundant copies in case of disaster or other. And if you set the intervals to short, you'll never get a working RP offsite.
AdrianHinton
Enthusiast
 
Posts: 71
Liked: 5 times
Joined: Mon Apr 07, 2014 10:00 am
Full Name: Adrian Hinton

Re: Triggering Copysync with powershell

Veeam Logoby foggy » Mon Feb 09, 2015 12:09 pm

Adrian, backup copy job designed to copy data to build a single restore point within each synchronization interval. If started again within the same interval and provided it has already successfully copied a restore point within this interval, it will do nothing until the interval expires. If you need to copy each restore point created by the corresponding backup job, adjust the synchronization interval according to the backup job schedule or use some third-party tool that will sync your entire repository offsite.
foggy
Veeam Software
 
Posts: 14742
Liked: 1079 times
Joined: Mon Jul 11, 2011 10:22 am
Full Name: Alexander Fogelson


Return to PowerShell



Who is online

Users browsing this forum: No registered users and 3 guests