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

Waiting for sync-vbrrepository

Post by tdewin »

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: 17777
Liked: 1625 times
Joined: Oct 26, 2012 3:28 pm
Full Name: Vladimir Eremin
Contact:

Re: Waiting for sync-vbrrepository

Post by veremin »

What about using the following example?

Code: Select all

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

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

Re: Waiting for sync-vbrrepository

Post by tdewin »

Thanks Vova, that seems exactly what I need ;)

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

Re: Waiting for sync-vbrrepository

Post by veremin »

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 »

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

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

Re: Waiting for sync-vbrrepository

Post by veremin »

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 »

Is this information stored somewhere ? Log or database perhaps?

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

Re: Waiting for sync-vbrrepository

Post by veremin »

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

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests