PowerShell script exchange
Post Reply
tdewin
Veeam Software
Posts: 1462
Liked: 466 times
Joined: Mar 02, 2012 1:40 pm
Full Name: Timothy Dewin
Contact:

Waiting for sync-vbrrepository

Post by tdewin » Apr 02, 2015 5:22 pm

Hi,

It seems that sync-vbrrepository is an async call. Anyway to wait for it? I tried

Code: Select all

PS V:\scripts> $operation = Get-VBRBackupRepository -Name "Backup Repository 8" | Sync-VBRBackupRepository;while ($operation.isWorking) { write-host "..."}
I don't know how I can update $operation to reflect changes. With backup jobs there is get-vbrtasksession but it doesn't work with this one

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

Re: Waiting for sync-vbrrepository

Post by veremin » Apr 03, 2015 11:55 am

What about using the following example?

Code: Select all

Get-VBRBackupRepository -Name "Name of repository" | Rescan-VBREntity -Wait
Thanks.

tdewin
Veeam Software
Posts: 1462
Liked: 466 times
Joined: Mar 02, 2012 1:40 pm
Full Name: Timothy Dewin
Contact:

Re: Waiting for sync-vbrrepository

Post by tdewin » Apr 03, 2015 3:35 pm

Thanks Vova, that seems exactly what I need ;)

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

Re: Waiting for sync-vbrrepository

Post by veremin » Apr 03, 2015 3:49 pm

You're welcome. -Wait switch is designed specifically for the described use case, so, feel free to leverage it.

scavern
Novice
Posts: 7
Liked: never
Joined: May 04, 2015 11:00 am
Contact:

Re: Waiting for sync-vbrrepository

Post by scavern » May 19, 2015 10:43 am

Just tagging onto this... is it possible to retrieve the date/time that the repository was last synced?

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

Re: Waiting for sync-vbrrepository

Post by veremin » May 19, 2015 10:55 am

As far as I'm concerned, it's not possible to get this information via PS. Thanks.

scavern
Novice
Posts: 7
Liked: never
Joined: May 04, 2015 11:00 am
Contact:

Re: Waiting for sync-vbrrepository

Post by scavern » May 19, 2015 11:01 am

Is this information stored somewhere ? Log or database perhaps?

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

Re: Waiting for sync-vbrrepository

Post by veremin » May 19, 2015 11:49 am

Most likely, this information is present inside the product database. Thanks.

Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests