PowerShell script exchange
Post Reply
AdrianHinton
Enthusiast
Posts: 71
Liked: 6 times
Joined: Apr 07, 2014 10:00 am
Full Name: Adrian Hinton
Contact:

Triggering Copysync with powershell

Post by AdrianHinton »

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.
nefes
Veeam Software
Posts: 643
Liked: 162 times
Joined: Dec 10, 2012 8:44 am
Full Name: Nikita Efes
Contact:

Re: Triggering Copysync with powershell

Post by nefes »

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)
AdrianHinton
Enthusiast
Posts: 71
Liked: 6 times
Joined: Apr 07, 2014 10:00 am
Full Name: Adrian Hinton
Contact:

Re: Triggering Copysync with powershell

Post by AdrianHinton »

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?
nefes
Veeam Software
Posts: 643
Liked: 162 times
Joined: Dec 10, 2012 8:44 am
Full Name: Nikita Efes
Contact:

Re: Triggering Copysync with powershell

Post by nefes »

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.
AdrianHinton
Enthusiast
Posts: 71
Liked: 6 times
Joined: Apr 07, 2014 10:00 am
Full Name: Adrian Hinton
Contact:

Re: Triggering Copysync with powershell

Post by AdrianHinton »

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.
foggy
Veeam Software
Posts: 21069
Liked: 2115 times
Joined: Jul 11, 2011 10:22 am
Full Name: Alexander Fogelson
Contact:

Re: Triggering Copysync with powershell

Post by foggy »

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.
Post Reply

Who is online

Users browsing this forum: No registered users and 14 guests